Browse files

Merge pull request #3805 from arunagw/active_model_patch_3-0-stable

Active model patch 3 0 stable
  • Loading branch information...
2 parents 13ad879 + be8485e commit 9ebacf3bf5c8878f405db66a3f55ca1ffea90452 @josevalim josevalim committed Nov 30, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 activemodel/lib/active_model/validations/confirmation.rb
View
4 activemodel/lib/active_model/validations/confirmation.rb
@@ -10,7 +10,9 @@ def validate_each(record, attribute, value)
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

0 comments on commit 9ebacf3

Please sign in to comment.