On Oct 19, 1:29 am, David Lee <[email protected]> wrote:
> Actually, I was calling #update. Doing a #set and then a #save
> successfully calls the after_save hook. I'm not sure if #save_changes
> (), and more specifically, #update(), should be skipping the
> #after_save hooks when there are no changed columns, although, as I
> expressed in the original post, I'm leaning towards thinking that all
> hooks be run.

#update calls #save_changes, which does two things:

1) Skips saving completely if the record has not been modified.

2) Saves only the changed columns if the record has been modified.

I don't think this behavior should change.  It's worked this way for a
long time, and I think it makes the most sense for the average user.

If it doesn't work well for your application, you can always override
save changes to do what you want:

  def save_changes
    save(:changed=>true)
  end

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