aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r--activemodel/lib/active_model/naming.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/naming.rb b/activemodel/lib/active_model/naming.rb
index 0706df4b59..fc2abacb6d 100644
--- a/activemodel/lib/active_model/naming.rb
+++ b/activemodel/lib/active_model/naming.rb
@@ -1,4 +1,5 @@
require 'active_support/inflector'
+require 'active_support/core_ext/hash/except'
module ActiveModel
class Name < String
@@ -35,10 +36,10 @@ module ActiveModel
klass.model_name.i18n_key
end
- defaults << options.delete(:default) if options[:default]
+ defaults << options[:default] if options[:default]
defaults << @human
- options.reverse_merge! :scope => [@klass.i18n_scope, :models], :count => 1, :default => defaults
+ options = {:scope => [@klass.i18n_scope, :models], :count => 1, :default => defaults}.merge(options.except(:default))
I18n.translate(defaults.shift, options)
end