-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:
Very similar to MONGOID-2127 except it also happens with referenced relations.
class Page has_many :components accepts_nested_attributes_for :components, :allow_destroy => true end class Component belongs_to :page after_save :touch_page def touch_page page.touch end end
When a nested component is given field _destroy = 1 and the page object is saved, the component callback is fired but returns undefined method 'touch' for nil:NilClass. It seems like page_id is getting wiped too soon. Same for after_destroy too. Is this normal?
mongoid (3.0.5)
rails (3.2.2)