diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-12-05 12:57:45 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-12-05 12:57:45 -0200 |
commit | 33b0a30fcc5694d26034bc74ed61e34edecbfbc4 (patch) | |
tree | 9a59f19c85d0e246dff026b4ff2be3b9474e7ecf /activemodel/lib | |
parent | 20ba81e47d04b0ffd510c4de9c65a439b22a00b2 (diff) | |
download | rails-33b0a30fcc5694d26034bc74ed61e34edecbfbc4.tar.gz rails-33b0a30fcc5694d26034bc74ed61e34edecbfbc4.tar.bz2 rails-33b0a30fcc5694d26034bc74ed61e34edecbfbc4.zip |
default could be a symbol here so attribute.to_s.humanize should be the final option
Diffstat (limited to 'activemodel/lib')
-rw-r--r-- | activemodel/lib/active_model/translation.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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) |