Closed chaofan closed 10 years ago
ruby-1.9.3-rc1, rails 3.2.1 Department < Group
ruby-1.9.3-rc1 :003 > Department.delete_all citier -> ids1: citier -> ids2: citier -> where_hash: , c.base_class:Group SQL (1.5ms) DELETE FROM groups citier -> Deleting back up hierarchy Department SQL (0.5ms) DELETE FROM departments => true
1: It seems subclass.delete_all delete all records of the base_class.
2: "return relation_delete_all(conditions) if conditions" could leave out records in parent_class and parent_parent_class ...
3: It returns a boolean and if there is a condition it returns a deleted records count.
@chaofan Would you like to try http://github.com/sishen/citier to see whether that fixes your problem or not? Thanks!
It fixed. Thanks!
ruby-1.9.3-rc1, rails 3.2.1 Department < Group
ruby-1.9.3-rc1 :003 > Department.delete_all citier -> ids1: citier -> ids2: citier -> where_hash: , c.base_class:Group SQL (1.5ms) DELETE FROM groups citier -> Deleting back up hierarchy Department SQL (0.5ms) DELETE FROM departments => true
1: It seems subclass.delete_all delete all records of the base_class.
2: "return relation_delete_all(conditions) if conditions" could leave out records in parent_class and parent_parent_class ...
3: It returns a boolean and if there is a condition it returns a deleted records count.