On Jul 18, 1:47 pm, Josh Susser <[EMAIL PROTECTED]> wrote:
> Yep, exactly.  I talked with David Dollar on IRC about this.  I've  
> done this in a way that is similar to your recipe in ARR, but I create/
> update the associated models in a before_validation callback, rather  
> than in the setter.  That keeps everything in one transaction and  
> makes it a little easier to handle validation issues.  I did like your  
> approach of splitting the setters into two pieces for create and  
> update.  The one thing that keeps bugging me though is doing deletes -  
> I've still yet to figure out a really nice way to handle that.

I'm going to have to try using a before_validation callback. Regarding
deletes, are you not happy with removing all children that are missing
in the params hash (as the recipe does)? I suppose it is a little
dangerous, but I can't think of an alternative solution which is close
to the same simplicity.

Ryan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to