This project is archived and is in readonly mode.
nested_attributes fails to update/destroy when association is loaded between setting attributes and saving parent
-
Luke Melia
- Tag set to association_proxy, nested_attributes_for
-
Luke Melia
- Tag changed from association_proxy, nested_attributes_for to 2.3.8, association_proxy, nested_attributes_for
-
Pratik
- Milestone cleared.
-
Pratik
- No changes were found…
-
Pratik
- Assigned user set to Pratik
-
David North
I think because of this commit, I'm having a related problem where records in a has_many association are not updated at all unless the collection is first loaded from the database.
The following worked before 2.3.8:
@order.update_attributes {"line_items_attributes"=>{"0"=>{"quantity"=>"2", "order_id"=>"1069267031", "id"=>"1070870199", "variant_id"=>"215054540"}}}It works now if I do this first:
@order.line_items(true) -
Sharad Jain
This also happens in rails 2.3.8
-
Rizwan Reza
- Milestone set to 2.3.9
-
Jarl Friis
@David North: You can figure out if the commit mentioned is the first bad commit using git bisect. Here is a rough description of how to do this: 0) open two terminals (one in your rails project, and one in your git version of rails)
1) in terminal 1: Change your project to use your git version of rails:ln -s /your/path/to/rails vendor/rails2) in terminal 2: do a git bisect (see http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html)
git bisect v2.3.8 v2.3.53) in terminal 1: test if the rails version is good or bad
ruby -I test test/integration/test_that_fails_in_2_3_8.rb --name "test: failing test"4) in terminal 2: use git bisect to determine next commit depending on result of step 3
git bisect [good|bad]5) repeat step 3-4 until step 4 reveals the first bad commit.
Jarl
-
Jarl Friis
I highly appreciate that milestone is 2.3.x and not 3.x, thanks.
-
Pete Deffendol
Duplicate of #4642?
-
James Le Cuirot
Yes, this is the same as my issue. I have proposed a solution that does not involve undoing the commit that broke it.
-
James Le Cuirot
This has now been fixed. See the other ticket.
