From 22ad30ed600a3304c749b0406325b3b43de3d607 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sat, 21 Mar 2009 01:11:38 +0000 Subject: Move validate_on_create and validate_on_update from ActiveModel to ActiveRecord --- activerecord/lib/active_record/validations/associated.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/validations/associated.rb') diff --git a/activerecord/lib/active_record/validations/associated.rb b/activerecord/lib/active_record/validations/associated.rb index 1d7df6b771..92f47d770f 100644 --- a/activerecord/lib/active_record/validations/associated.rb +++ b/activerecord/lib/active_record/validations/associated.rb @@ -33,8 +33,7 @@ module ActiveRecord # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The # method, proc or string should return or evaluate to a true or false value. def validates_associated(*attr_names) - configuration = { :on => :save } - configuration.update(attr_names.extract_options!) + configuration = attr_names.extract_options! validates_each(attr_names, configuration) do |record, attr_name, value| unless (value.is_a?(Array) ? value : [value]).collect { |r| r.nil? || r.valid? }.all? -- cgit v1.2.3