Permalink
Browse files

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

  • Loading branch information...
1 parent 0dbf4ac commit 3ab98cf6e0d399042424d44a788b8bc679b8dd1c @spastorino spastorino committed Dec 5, 2010
Showing with 1 addition and 2 deletions.
  1. +1 −2 activemodel/lib/active_model/translation.rb
@@ -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)

0 comments on commit 3ab98cf

Please sign in to comment.