I have a model with a callback that runs after_update
:
after_update :set_state
protected
def set_state
if self.valid?
self.state = 'complete'
else
self.state = 'in_progress'
end
end
But it doesn't actually save those values, why not? Regardless of if the model is valid or not it won't even write anything, even if i remove the if self.valid?
condition, I can't seem to save the state.
Um, this might sound dumb, do I need to run save
on it?
update
Actually, I can't run save
there because it results in an infinite loop. [sighs]