This project is archived and is in readonly mode.
association_collection#create acts as association_collection#create!
-
Michael Koziarski
- Tag changed from activerecord to activerecord, bugmash
-
railsbob
Verified
I was able to reproduce this error with the help of mentioned example.
-
railsbob
I have attached a patch for the failing test case.
-
railsbob
The following patch fixes the error.
-
Dan Croak
-1 patches do not apply cleanly in 2-3-stable
-
José Valim
Just to add a notice, I asked @railsbob to rebase the patch and improve test coverage. Here is a example of tests for has_many: http://pastie.org/576732
-
railsbob
Sorry, please ignore the previous patch (whitespace error). This one applies cleanly.
-
railsbob
As discussed with lifo, the previous patch is modifying << method. I am attaching another patch, which removes << from create method.
-
Rizwan Reza
verified
+1 The patch works cleanly on master but does not in 2-3-stable.
-
Dan Croak
verified 2934_fixed.diff does not apply cleanly to 2-3-stable.
-
Dan Croak
I've attached a patch that works for 2-3-stable. It was modified from railsbob's 2934_fixed.diff patch for master. I don't think it is possible to have a single patch that will work for both, at least without serious refactoring of one of the tests.
-
Jeremy Kemper
- State changed from new to committed
- Tag changed from activerecord, bugmash to activerecord
- Milestone cleared.
-
Repository
(from [33c054d7e04672201e120a0f8da38166650f3a94]) has_many :through create should not raise validation errors
[#2934 association_collection#create acts as association_collection#create! state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/33c054d7e04672201e120a0f8da381... -
Repository
(from [e06a0b03c8ba29f4b05a35560645814ac88aefbe]) has_many :through create should not raise validation errors
[#2934 association_collection#create acts as association_collection#create! state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/e06a0b03c8ba29f4b05a3556064581...
