I am trying to do an after_save conditional callback
after_save :change_rel_status, :if => :relation_type_id == 1
def change_rel_status
self.status = "Confirmed"
self.save
end
But I get the error message undefined method after_save for false:FalseClass
{"utf8"=>"✓",
"_method"=>"put",
"authenticity_token"=>"f4IN...=",
"relationship"=>{"relation_type_id"=>"1",
"category_ids"=>[""]},
"commit"=>"Update Relationship",
"id"=>"19"}
I am not sure if it’s because the form also has other attributes from other models that were not updated?
Thanks.
May I suggest something simpler: