aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/pirate.rb
diff options
context:
space:
mode:
authorEloy Duran <eloy.de.enige@gmail.com>2009-11-06 23:53:33 +0100
committerEloy Duran <eloy.de.enige@gmail.com>2009-11-07 00:42:42 +0100
commitf125a34501e21b1e0da2b80d149df7a739482804 (patch)
treef7094f45c45ef64e5b110130bfe6ff41a4ae801a /activerecord/test/models/pirate.rb
parentc2cfb201984f8dff2b3534163b6145fe2560eb80 (diff)
downloadrails-f125a34501e21b1e0da2b80d149df7a739482804.tar.gz
rails-f125a34501e21b1e0da2b80d149df7a739482804.tar.bz2
rails-f125a34501e21b1e0da2b80d149df7a739482804.zip
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]
Diffstat (limited to 'activerecord/test/models/pirate.rb')
-rw-r--r--activerecord/test/models/pirate.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/models/pirate.rb b/activerecord/test/models/pirate.rb
index 05c5b666ae..f2c05dd48f 100644
--- a/activerecord/test/models/pirate.rb
+++ b/activerecord/test/models/pirate.rb
@@ -18,7 +18,7 @@ class Pirate < ActiveRecord::Base
has_many :treasure_estimates, :through => :treasures, :source => :price_estimates
# These both have :autosave enabled because accepts_nested_attributes_for is used on them.
- has_one :ship, :validate => true
+ has_one :ship
has_one :non_validated_ship, :class_name => 'Ship'
has_many :birds
has_many :birds_with_method_callbacks, :class_name => "Bird",