diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 19:38:33 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 19:38:33 +0200 |
commit | 5c315a8fa6296904f5e0ba8da919fc395548cf98 (patch) | |
tree | c20da9c73b5db9caa8c2aa711955ed17f01d396d /activesupport/lib/active_support/number_helper | |
parent | d22e522179c1c90e658c3ed0e9b972ec62306209 (diff) | |
download | rails-5c315a8fa6296904f5e0ba8da919fc395548cf98.tar.gz rails-5c315a8fa6296904f5e0ba8da919fc395548cf98.tar.bz2 rails-5c315a8fa6296904f5e0ba8da919fc395548cf98.zip |
modernizes hash syntax in activesupport
Diffstat (limited to 'activesupport/lib/active_support/number_helper')
-rw-r--r-- | activesupport/lib/active_support/number_helper/number_to_human_converter.rb | 4 | ||||
-rw-r--r-- | activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/number_helper/number_to_human_converter.rb b/activesupport/lib/active_support/number_helper/number_to_human_converter.rb index bed1b2701b..695ee1dad3 100644 --- a/activesupport/lib/active_support/number_helper/number_to_human_converter.rb +++ b/activesupport/lib/active_support/number_helper/number_to_human_converter.rb @@ -40,7 +40,7 @@ module ActiveSupport when Hash units[exp] || "" when String, Symbol - I18n.translate("#{units}.#{exp}", :locale => options[:locale], :count => number.to_i) + I18n.translate("#{units}.#{exp}", locale: options[:locale], count: number.to_i) else translate_in_locale("human.decimal_units.units.#{exp}", count: number.to_i) end @@ -56,7 +56,7 @@ module ActiveSupport when Hash units when String, Symbol - I18n.translate(units.to_s, :locale => options[:locale], :raise => true) + I18n.translate(units.to_s, locale: options[:locale], raise: true) when nil translate_in_locale("human.decimal_units.units", raise: true) else diff --git a/activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb b/activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb index fbd107463a..2b8ff77986 100644 --- a/activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb +++ b/activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb @@ -30,11 +30,11 @@ module ActiveSupport private def conversion_format - translate_number_value_with_default("human.storage_units.format", :locale => options[:locale], :raise => true) + translate_number_value_with_default("human.storage_units.format", locale: options[:locale], raise: true) end def unit - translate_number_value_with_default(storage_unit_key, :locale => options[:locale], :count => number.to_i, :raise => true) + translate_number_value_with_default(storage_unit_key, locale: options[:locale], count: number.to_i, raise: true) end def storage_unit_key |