Calling accessor methods from within a Model object in Rails
-
12-11-2019 - |
题
I have the following method in my model
def reset_review_status
needs_review = true
save
end
There is an attribute on the model called needs_review, however when I debug it, it saves it as a new variable. If I do self.needs_review=true
, it works fine. I have no attr_accessible clause, although I do have one accepts_nested_attributes_for.
Any thoughts on why this might be happening?
没有正确的解决方案
不隶属于 StackOverflow