aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/validations/acceptance.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/lib/active_model/validations/acceptance.rb')
-rw-r--r--activemodel/lib/active_model/validations/acceptance.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/validations/acceptance.rb b/activemodel/lib/active_model/validations/acceptance.rb
index 38abd0c1fa..43651094cf 100644
--- a/activemodel/lib/active_model/validations/acceptance.rb
+++ b/activemodel/lib/active_model/validations/acceptance.rb
@@ -2,9 +2,9 @@ module ActiveModel
# == Active Model Acceptance Validator
module Validations
- class AcceptanceValidator < EachValidator
+ class AcceptanceValidator < EachValidator #:nodoc:
def initialize(options)
- super(options.reverse_merge(:allow_nil => true, :accept => "1"))
+ super({ :allow_nil => true, :accept => "1" }.merge!(options))
end
def validate_each(record, attribute, value)
@@ -58,7 +58,7 @@ module ActiveModel
# <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>).
# The method, proc or string should return or evaluate to a true or
# false value.
- # * <tt>:strict</tt> - Specifies whether validation should be strict.
+ # * <tt>:strict</tt> - Specifies whether validation should be strict.
# See <tt>ActiveModel::Validation#validates!</tt> for more information.
def validates_acceptance_of(*attr_names)
validates_with AcceptanceValidator, _merge_attributes(attr_names)