diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-11-11 11:41:15 -0500 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-11-24 22:08:36 +0100 |
commit | 66212f69acc3d51af10ff76a18ff4c0bfa305ea5 (patch) | |
tree | 5cf9877fcecd1d88871eb55490e2bd7e7095f56b /activerecord/test/models | |
parent | 18adbe9347727dc3eefe46395d52aafa347a0c73 (diff) | |
download | rails-66212f69acc3d51af10ff76a18ff4c0bfa305ea5.tar.gz rails-66212f69acc3d51af10ff76a18ff4c0bfa305ea5.tar.bz2 rails-66212f69acc3d51af10ff76a18ff4c0bfa305ea5.zip |
If a nested_attribute is being marked for destruction and at the same time an attr_accessor value is being assigned then the value being assigned is being ignored. This patch is a fix for that issue.
[#5939 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/pet.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/models/pet.rb b/activerecord/test/models/pet.rb index a8bf94dd86..570db4c8d5 100644 --- a/activerecord/test/models/pet.rb +++ b/activerecord/test/models/pet.rb @@ -1,5 +1,13 @@ class Pet < ActiveRecord::Base + + attr_accessor :current_user + set_primary_key :pet_id belongs_to :owner, :touch => true has_many :toys + + after_destroy do |record| + $after_destroy_callback_output = record.current_user + end + end |