aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-12-05 12:34:58 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2010-12-05 12:36:56 -0200
commit3ab98cf6e0d399042424d44a788b8bc679b8dd1c (patch)
treed2900edb922ec4f24d3edac8c1de4328555cb681 /activemodel
parent0dbf4ac709c0c31d4d6664bcb53b861c6d6b0157 (diff)
downloadrails-3ab98cf6e0d399042424d44a788b8bc679b8dd1c.tar.gz
rails-3ab98cf6e0d399042424d44a788b8bc679b8dd1c.tar.bz2
rails-3ab98cf6e0d399042424d44a788b8bc679b8dd1c.zip
If default is provided don't add attribute.to_s.humanize to the options
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/translation.rb3
1 files changed, 1 insertions, 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)