Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

If default is provided don't add attribute.to_s.humanize to the options

  • Loading branch information...
commit 3ab98cf6e0d399042424d44a788b8bc679b8dd1c 1 parent 0dbf4ac
Santiago Pastorino spastorino authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  activemodel/lib/active_model/translation.rb
3  activemodel/lib/active_model/translation.rb
View
@@ -48,8 +48,7 @@ def human_attribute_name(attribute, options = {})
end
defaults << :"attributes.#{attribute}"
- defaults << options.delete(:default) if options[:default]
- defaults << attribute.to_s.humanize
+ defaults << (options[:default] ? options.delete(:default) : attribute.to_s.humanize)
options.reverse_merge! :count => 1, :default => defaults
I18n.translate(defaults.shift, options)
Please sign in to comment.
Something went wrong with that request. Please try again.