Sean Griffin
56a3d5ec91
Don't redefine autosave association callbacks in nested attrs
...
These callbacks will already have been defined when the association was
built. The check against `reflection.autosave` happens at call time, not
at define time, so simply modifying the reflection is sufficient.
Fixes #18704
2015-01-28 09:53:38 -07:00
claudiob
bb78af73ab
Deprecate false
as the way to halt AR callbacks
...
Before this commit, returning `false` in an ActiveRecord `before_` callback
such as `before_create` would halt the callback chain.
After this commit, the behavior is deprecated: will still work until
the next release of Rails but will also display a deprecation warning.
The preferred way to halt a callback chain is to explicitly `throw(:abort)`.
2015-01-02 15:31:56 -08:00
Erik Michaels-Ober
d1374f99bf
Pass symbol as an argument instead of a block
2014-11-29 11:53:24 +01:00
Eric Chahin
c6d685ba11
Fixed custom validation context bug where child
...
associations were not being saved.
Fixes #13854 .
[Eric Chahin, Aaron Nelson, & Kevin Casey]
2014-05-01 03:27:24 -04:00
Aaron Patterson
358802b850
Revert "context in validation goes through has many relationship"
...
This reverts commit 5e3d466d52
.
2014-02-20 11:26:07 -08:00
Kevin Casey
5e3d466d52
context in validation goes through has many relationship
2014-02-08 08:44:10 -08:00
Ian White
b439d85a19
Nested records (re: autosave) are now updated even when the intermediate parent record is unchanged [ #4242 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-18 16:13:00 +02:00
Eloy Duran
f2aacd5140
Rollback the transaction when one of the autosave associations fails to save. [ #3391 state:resolved]
2010-01-08 21:45:02 +01:00
Eloy Duran
c23fbd0d47
Refactored previous changes to nested attributes.
2009-12-28 21:09:22 +01:00
Eloy Duran
f125a34501
Define autosave association callbacks when using accepts_nested_attributes_for.
...
This way we don't define all the validation methods for all associations by
default, but only when needed.
[#3355 state:resolved]
2009-11-07 00:42:42 +01:00
Alexey Kovyrin
938c0ee045
Define autosave association validation methods only when needed. [ #3161 state:resolved]
...
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-09-12 16:04:36 +02:00
Lance Ivy
5dbc9d40a4
Changed API of NestedAttributes to take an array, or hash with index keys, of hashes that have the id on the inside of the attributes hash and updated the FormBuilder to produce such hashes. Also fixed NestedAttributes with composite ids.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
[#1892 state:committed]
2009-02-13 21:47:56 +13:00
Eloy Duran
ec8f045844
Add support for nested object forms to ActiveRecord and the helpers in ActionPack
...
Signed-Off-By: Michael Koziarski <michael@koziarski.com>
[#1202 state:committed]
2009-02-01 14:44:30 +13:00
Jeremy Kemper
43b81d01d0
move assets and models
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8657 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:27:03 +00:00