From f125a34501e21b1e0da2b80d149df7a739482804 Mon Sep 17 00:00:00 2001 From: Eloy Duran Date: Fri, 6 Nov 2009 23:53:33 +0100 Subject: 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] --- activerecord/test/models/pirate.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/test/models/pirate.rb') 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", -- cgit v1.2.3