I am using MySQL2 and the CITIER gem as currently available through git. I have a Status root-class and a LinkStatus subclass.
When I try to destroy either a Status or any LinkStatus, it doesn't work:
pry(main)> LinkStatus.last.destroy
citier -> Non Root Class
citier -> table_name -> link_statuses
citier -> tablename (view) -> view_link_statuses
LinkStatus Load (3.3ms) SELECT `view_link_statuses`.* FROM `view_link_statuses` WHERE `view_link_statuses`.`type` IN ('LinkStatus') ORDER BY `view_link_statuses`.`id` DESC LIMIT 1
(0.1ms) BEGIN
SQL (0.2ms) DELETE FROM `statuses` WHERE `statuses`.`id` IS NULL
citier -> Deleting back up hierarchy LinkStatus
SQL (0.1ms) DELETE FROM `link_statuses` WHERE `link_statuses`.`id` IS NULL
(0.1ms) COMMIT
=> #<LinkStatus id: 2, [...]>
pry(main)> Status.last.destroy
Status Load (0.4ms) SELECT `statuses`.* FROM `statuses` ORDER BY `statuses`.`id` DESC LIMIT 1
(0.1ms) BEGIN
SQL (0.2ms) DELETE FROM `statuses` WHERE `statuses`.`id` IS NULL
(0.1ms) COMMIT
=> #<Status id: 7, [...]>
As you can see, the executed DELETE query looks for a record with id IS NULL, instead of id = 2 and id = 7 respectively.
It could very well be that this isn't a bug in CITIER and that I'm doing something wrong, but I couldn't find a better place to post this.
I am using MySQL2 and the CITIER gem as currently available through git. I have a Status root-class and a LinkStatus subclass.
When I try to destroy either a Status or any LinkStatus, it doesn't work:
As you can see, the executed
DELETE
query looks for a record withid IS NULL
, instead ofid = 2
andid = 7
respectively.It could very well be that this isn't a bug in CITIER and that I'm doing something wrong, but I couldn't find a better place to post this.