Re: Using before_save to update a record only once.

bcparanj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-03-01T05:42:53Z

Of course there is another way, you could write your own plugin
acts_as_update_once to do this across all your controllers. Make sure
that the logic you use short-circuits quickly for the condition that
happens most of the time. This way performance will be good.

On Feb 28, 1:31 pm, MenDAKE
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
> I''d like to use before_save to perform an action (I won''t
get into the
> details), but only the first time the record is changed from 0 to 1.
> Here''s the code I have so far in my model: