aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/validations/confirmation.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/lib/active_model/validations/confirmation.rb')
-rw-r--r--activemodel/lib/active_model/validations/confirmation.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/validations/confirmation.rb b/activemodel/lib/active_model/validations/confirmation.rb
index 5e13db7491..3a80893866 100644
--- a/activemodel/lib/active_model/validations/confirmation.rb
+++ b/activemodel/lib/active_model/validations/confirmation.rb
@@ -6,11 +6,11 @@ module ActiveModel
def validate_each(record, attribute, value)
confirmed = record.send(:"#{attribute}_confirmation")
return if confirmed.nil? || value == confirmed
- record.errors.add(attribute, :confirmation, :default => options[:message])
+ record.errors.add(attribute, :confirmation, options)
end
-
+
def setup(klass)
- klass.send(:attr_accessor, *attributes.map { |attribute| :"#{attribute}_confirmation" })
+ klass.send(:attr_accessor, *attributes.map { |attribute| :"#{attribute}_confirmation" })
end
end