-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
I have a model like this:
class Model include Mongoid::Document field :a field :b field :is_a_equal_b type: Boolean before_save :update_is_a_equal_b def update_is_a_equal_b self.is_a_equal_b = (self.a == self.b) end end
In this case, whenever a is not equal to b in this class, the update will fail due to callback is false. So what I did to fix this is:
def update_is_a_equal_b
self.is_a_equal_b = (self.a == self.b)
true
end
I think this should be a bug.