Active model patch 3 0 stable #3805

Merged
merged 1 commit into from Nov 30, 2011
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