From 33b0a30fcc5694d26034bc74ed61e34edecbfbc4 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 5 Dec 2010 12:57:45 -0200 Subject: default could be a symbol here so attribute.to_s.humanize should be the final option --- activemodel/lib/active_model/translation.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activemodel/lib/active_model/translation.rb') diff --git a/activemodel/lib/active_model/translation.rb b/activemodel/lib/active_model/translation.rb index 6959f99b5e..920a133159 100644 --- a/activemodel/lib/active_model/translation.rb +++ b/activemodel/lib/active_model/translation.rb @@ -48,7 +48,8 @@ module ActiveModel end defaults << :"attributes.#{attribute}" - defaults << (options[:default] ? options.delete(:default) : attribute.to_s.humanize) + defaults << options.delete(:default) if options[:default] + defaults << attribute.to_s.humanize options.reverse_merge! :count => 1, :default => defaults I18n.translate(defaults.shift, options) -- cgit v1.2.3