PeterHamilton/citier — Issue #53: relation_methods.rb delete_all strange behavior
Author: chaofan
Created: 2012-02-11 01:53:53+00:00
State: open

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 reords count.