diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2015-08-10 23:15:09 -0400 |
---|---|---|
committer | Jean Boussier <jean.boussier@gmail.com> | 2015-08-10 23:15:09 -0400 |
commit | 708110645722e1cd4cde0613ee6214cdd1b46db9 (patch) | |
tree | 13c649b8f7fb464edf24cf4542817804f5c47799 /activesupport | |
parent | 8adf25a6323ad20302d7009d482ec01491ec92eb (diff) | |
download | rails-708110645722e1cd4cde0613ee6214cdd1b46db9.tar.gz rails-708110645722e1cd4cde0613ee6214cdd1b46db9.tar.bz2 rails-708110645722e1cd4cde0613ee6214cdd1b46db9.zip |
Deprecate the :prefix option of `number_to_human_size`
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/number_helper.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/number_helper.rb b/activesupport/lib/active_support/number_helper.rb index 258d9b34e1..38a9ce361d 100644 --- a/activesupport/lib/active_support/number_helper.rb +++ b/activesupport/lib/active_support/number_helper.rb @@ -220,8 +220,6 @@ module ActiveSupport # * <tt>:strip_insignificant_zeros</tt> - If +true+ removes # insignificant zeros after the decimal separator (defaults to # +true+) - # * <tt>:prefix</tt> - If +:si+ formats the number using the SI - # prefix (defaults to :binary) # # ==== Examples # 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 ac0d20b454..a4a8690bcd 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 @@ -7,6 +7,10 @@ module ActiveSupport self.validate_float = true def convert + if opts.key?(:prefix) + ActiveSupport::Deprecation.warn('The :prefix option of `number_to_human_size` is deprecated and will be removed in Rails 5.1 with no replacement.') + end + @number = Float(number) # for backwards compatibility with those that didn't add strip_insignificant_zeros to their locale files |