我正在尝试执行 after_save 条件回调
after_save :change_rel_status, :if => :relation_type_id == 1
def change_rel_status
self.status = "Confirmed"
self.save
end
但我收到错误消息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"}
我不确定是不是因为表单还有其他模型的其他属性没有更新?
谢谢。