[Rails] Collection add saves to the database twice

2011-03-10 Thread danm
I've got something weird happening in the code (using Rails 3.0). I have a ton of has_many/belongs_to relationships in my application and I save the child objects like this: if parent.child_collection child #do success code else #do error code end The problem is that this ends up with

Re: [Rails] Collection add saves to the database twice

2011-03-10 Thread Bryan Crossland
On Thu, Mar 10, 2011 at 3:00 PM, danm dmuch...@gmail.com wrote: I've got something weird happening in the code (using Rails 3.0). I have a ton of has_many/belongs_to relationships in my application and I save the child objects like this: if parent.child_collection child #do success code

Re: [Rails] Collection add saves to the database twice

2011-03-10 Thread Colin Law
On 10 March 2011 21:00, danm dmuch...@gmail.com wrote: I've got something weird happening in the code (using Rails 3.0).  I have a ton of has_many/belongs_to relationships in my application and I save the child objects like this: if parent.child_collection child  #do success code else