aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorAndrew Kaspick <andrew@redlinesoftware.com>2011-12-14 20:13:03 -0600
committerAndrew Kaspick <andrew@redlinesoftware.com>2011-12-14 20:13:03 -0600
commit774ff18c095145f544e845dbb940378546748969 (patch)
tree2790c29a416f4492690222fd36b6f4f500b8a942 /activerecord/test/models
parentb6105b0b59073efe7d8c5fad0b2246d0534030e1 (diff)
downloadrails-774ff18c095145f544e845dbb940378546748969.tar.gz
rails-774ff18c095145f544e845dbb940378546748969.tar.bz2
rails-774ff18c095145f544e845dbb940378546748969.zip
Allow nested attributes in associations to update values in it's owner object. Fixes a regression from 3.0.x
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/bird.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/test/models/bird.rb b/activerecord/test/models/bird.rb
index e61d48e6a5..dff099c1fb 100644
--- a/activerecord/test/models/bird.rb
+++ b/activerecord/test/models/bird.rb
@@ -1,9 +1,12 @@
class Bird < ActiveRecord::Base
+ belongs_to :pirate
validates_presence_of :name
+ accepts_nested_attributes_for :pirate
+
attr_accessor :cancel_save_from_callback
before_save :cancel_save_callback_method, :if => :cancel_save_from_callback
def cancel_save_callback_method
false
end
-end \ No newline at end of file
+end