aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2013-02-22 14:00:24 -0800
committerSteve Klabnik <steve@steveklabnik.com>2013-02-22 14:00:24 -0800
commit4ffcd83dea4248652aa2bd92ada3b603ac179450 (patch)
tree4a175bbd86485f55e6647f82f1bc305536c2f550 /activesupport/lib
parente4c2a13b1be2aa22c98b9581110aa72b39176c47 (diff)
parent4e3ceedeba4f95d6f51380277c5562049ccdc264 (diff)
downloadrails-4ffcd83dea4248652aa2bd92ada3b603ac179450.tar.gz
rails-4ffcd83dea4248652aa2bd92ada3b603ac179450.tar.bz2
rails-4ffcd83dea4248652aa2bd92ada3b603ac179450.zip
Merge pull request #9347 from hoffm/number_to_human_bug
Address edge case for number_to_human with units option.
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/number_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/number_helper.rb b/activesupport/lib/active_support/number_helper.rb
index 2191471daa..cc935e6cb9 100644
--- a/activesupport/lib/active_support/number_helper.rb
+++ b/activesupport/lib/active_support/number_helper.rb
@@ -580,7 +580,7 @@ module ActiveSupport
unit = case units
when Hash
- units[DECIMAL_UNITS[display_exponent]]
+ units[DECIMAL_UNITS[display_exponent]] || ''
when String, Symbol
I18n.translate(:"#{units}.#{DECIMAL_UNITS[display_exponent]}", :locale => options[:locale], :count => number.to_i)
else