petehamilton / citier

CITIER (Class Inheritance & Table Inheritance Embeddings for Rails) is a solution for simple Multiple Class Inheritance in Rails.
88 stars 24 forks source link

relation_methods.rb delete_all strange behavior #53

Closed chaofan closed 10 years ago

chaofan commented 12 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.

sishen commented 11 years ago

@chaofan Would you like to try http://github.com/sishen/citier to see whether that fixes your problem or not? Thanks!

chaofan commented 10 years ago

It fixed. Thanks!