On Oct 18, 1:37 am, David Lee <[email protected]> wrote:
> Right now, I have some logic that runs inside the after_save hook, but
> those aren't getting called when I call #save() if there have been no
> changes to values. I'm not sure if the correct behavior is to always
> be called after #save() or only be called after a real UPDATE/INSERT.
> I'm thinking it should always be called after #save() since the change
> detection stuff is only an optimization not meant to affect anything
> else. In other words, #save() should always behave as if UPDATE/INSERT
> were called, even if the actual UPDATE is sometimes skipped for
> performance's sake.

Model#save should always call #after_save unless validation fails or
one of the before hooks returns false.  However Model#save_changes and
Model#update do not call #save if #modified? returns false.

If you are experiencing different behavior, can you try to create an
self contained example showing the problem?

Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to