From 3ab98cf6e0d399042424d44a788b8bc679b8dd1c Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 5 Dec 2010 12:34:58 -0200 Subject: If default is provided don't add attribute.to_s.humanize to the options --- activemodel/lib/active_model/translation.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/activemodel/lib/active_model/translation.rb b/activemodel/lib/active_model/translation.rb index 920a133159..6959f99b5e 100644 --- a/activemodel/lib/active_model/translation.rb +++ b/activemodel/lib/active_model/translation.rb @@ -48,8 +48,7 @@ module ActiveModel 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) -- cgit v1.2.3