diff options
author | José Valim <jose.valim@gmail.com> | 2010-09-27 21:00:54 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-27 21:00:54 +0200 |
commit | fe0251e408a8b5d1ee149c7cad7bcfc495ce1595 (patch) | |
tree | 620f92c8485809ded3cd4081966d147efc8ad806 /activemodel/lib/active_model/validations/confirmation.rb | |
parent | 6067d1620075c1c311bbae01993453cd80967804 (diff) | |
parent | 50decfbc0e2e58961cc3665710922860d38ee2fb (diff) | |
download | rails-fe0251e408a8b5d1ee149c7cad7bcfc495ce1595.tar.gz rails-fe0251e408a8b5d1ee149c7cad7bcfc495ce1595.tar.bz2 rails-fe0251e408a8b5d1ee149c7cad7bcfc495ce1595.zip |
Merge remote branch 'miloops/warnings'
Conflicts:
actionpack/lib/action_controller/metal/url_for.rb
Diffstat (limited to 'activemodel/lib/active_model/validations/confirmation.rb')
-rw-r--r-- | activemodel/lib/active_model/validations/confirmation.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations/confirmation.rb b/activemodel/lib/active_model/validations/confirmation.rb index 2c8a840124..00df10cef0 100644 --- a/activemodel/lib/active_model/validations/confirmation.rb +++ b/activemodel/lib/active_model/validations/confirmation.rb @@ -10,7 +10,9 @@ module ActiveModel end def setup(klass) - klass.send(:attr_accessor, *attributes.map { |attribute| :"#{attribute}_confirmation" }) + klass.send(:attr_accessor, *attributes.map do |attribute| + :"#{attribute}_confirmation" unless klass.method_defined?(:"#{attribute}_confirmation") + end.compact) end end |