aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-04-28 11:23:29 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-04-28 11:23:29 -0300
commitcafe6a38f5478403bf249ec9a9a39ff836849ff7 (patch)
tree951d1a36354beefdfb41b524ae0a8fcc82434758 /activemodel/lib/active_model
parent9fc9e894771d1915fe3e565305424ed9ca537b79 (diff)
downloadrails-cafe6a38f5478403bf249ec9a9a39ff836849ff7.tar.gz
rails-cafe6a38f5478403bf249ec9a9a39ff836849ff7.tar.bz2
rails-cafe6a38f5478403bf249ec9a9a39ff836849ff7.zip
Do not modify options hash in human_attribute_name, remove reverse_merge
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r--activemodel/lib/active_model/translation.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/translation.rb b/activemodel/lib/active_model/translation.rb
index 02b7c54d61..7a472e2d43 100644
--- a/activemodel/lib/active_model/translation.rb
+++ b/activemodel/lib/active_model/translation.rb
@@ -1,5 +1,3 @@
-require 'active_support/core_ext/hash/reverse_merge'
-
module ActiveModel
# == Active Model Translation
@@ -43,6 +41,7 @@ module ActiveModel
#
# Specify +options+ with additional translating options.
def human_attribute_name(attribute, options = {})
+ options = { :count => 1 }.merge!(options)
defaults = []
parts = attribute.to_s.split(".", 2)
attribute = parts.pop
@@ -63,7 +62,7 @@ module ActiveModel
defaults << options.delete(:default) if options[:default]
defaults << attribute.humanize
- options.reverse_merge! :count => 1, :default => defaults
+ options[:default] = defaults
I18n.translate(defaults.shift, options)
end
end