I use accepts_nested_attributes
in my model parent and the parent model has belongs_to association with children model. I am trying to use callbacks in my children model (after_update
, after_create
).When update_attributes used in parents_controller to update the parent record.The callbacks after_create
is working fine but after_update
is not triggering.
class Parent
accepts_nested_attributes :children
belongs_to :children
end
class Children
before_save :saving
after_update :test
has_many :parents
end
Help me to solve this problem?