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?

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top