I'm getting a Stack Level too deep
error and I think it's to do with the following code but i'm not sure how to fix it:
after_save :update_milestone
def update_milestone
if order % 50 == 0
self.update_attributes(is_milestone: true)
else
self.update_attributes(is_milestone: false)
end
end
Any thoughts
You are calling update_attributes which hits validations. This then triggers the callback after_save which is causing the errors.
You want:
This won't trigger validations.