> Because of the way the internals work, this wouldn't be easy to do
> cleanly.  Can you give me an example of an after_update hook you are
> using that you would want to be run regardless?

One simple example would be to save assocations:

  class User
    one_to_many :pictures
 
    def pictures=(imgs)
      @imgs = imgs
    end

    def after_save
      save_pictures_with_user_id(id)
    end
  end

  user = User.create(:name => 'Bob', :pictures => imgs) # works
  user.update(:name => 'Bob', :pictures => other_imgs) # does not work
  user.update(:name => 'Sally', :pictures => other_imgs) # works

  User[123].update(:name => 'Bob', :pictures => imgs) # works if user
name was not Bob
  User[456].update(:name => 'Bob', :pictures => imgs) # does not work
if user name was Bob

--~--~---------~--~----~------------~-------~--~----~
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