diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-09 14:04:58 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-09 14:04:58 +0000 |
commit | d33f814db500538cee14b3db83afaef5f671a692 (patch) | |
tree | 7e584e58cf975e667b040ea3b72daf8c16411474 /activerecord/lib | |
parent | a65f791fbd8cf16d17a963f32c7b85a5659c04e0 (diff) | |
download | rails-d33f814db500538cee14b3db83afaef5f671a692.tar.gz rails-d33f814db500538cee14b3db83afaef5f671a692.tar.bz2 rails-d33f814db500538cee14b3db83afaef5f671a692.zip |
Changed the Proc for a string to avoid repetition problems
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@96 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/validations.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 25c43386fd..705cad20df 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -75,11 +75,9 @@ module ActiveRecord def validate_confirmation(*attr_names) for attr_name in attr_names attr_accessor "#{attr_name}_confirmation" - class_eval <<-EOC - validate_on_create(Proc.new { |record| - record.errors.add("#{attr_name}", "doesn't match confirmation") unless record.#{attr_name} == record.#{attr_name}_confirmation - }) -EOC + class_eval <<-EOM + validate_on_create %{errors.add('#{attr_name}', "doesn't match confirmation") unless #{attr_name} == #{attr_name}_confirmation} +EOM end end end |