Permalink
Browse files

Use default + merge! instead of reverse_merge

Since we're not directly requiring the reverse_merge extension, we can
avoid another hash creation by using default_hash.merge! instead.
  • Loading branch information...
1 parent 0ee6aa7 commit fef781cac4cb6ff6482307f3c253bdc01d4bed82 @carlosantoniodasilva carlosantoniodasilva committed Jun 25, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activemodel/lib/active_model/validations/acceptance.rb
View
2 activemodel/lib/active_model/validations/acceptance.rb
@@ -4,7 +4,7 @@ module ActiveModel
module Validations
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)

0 comments on commit fef781c

Please sign in to comment.