Skip to content
This repository
Browse code

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...
commit fef781cac4cb6ff6482307f3c253bdc01d4bed82 1 parent 0ee6aa7
Carlos Antonio da Silva carlosantoniodasilva authored
2  activemodel/lib/active_model/validations/acceptance.rb
@@ -4,7 +4,7 @@ module ActiveModel
4 4 module Validations
5 5 class AcceptanceValidator < EachValidator #:nodoc:
6 6 def initialize(options)
7   - super(options.reverse_merge(:allow_nil => true, :accept => "1"))
  7 + super({ :allow_nil => true, :accept => "1" }.merge!(options))
8 8 end
9 9
10 10 def validate_each(record, attribute, value)

0 comments on commit fef781c

Please sign in to comment.
Something went wrong with that request. Please try again.