Skip to content

Commit

Permalink
If default is provided don't add attribute.to_s.humanize to the options
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Dec 5, 2010
1 parent 0dbf4ac commit 3ab98cf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions activemodel/lib/active_model/translation.rb
Expand Up @@ -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)
Expand Down

0 comments on commit 3ab98cf

Please sign in to comment.