aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-08-11 00:51:38 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-08-11 00:51:38 -0300
commitb8646419e49f555b0cb28a27abac132542a38d6d (patch)
tree1be1bda38f092d6216eec4725371d491cf26350e /activesupport/lib
parent30608648efc227c3ae24bd8cfa62deb20e2c9648 (diff)
parente96403bd5cf2135651b8b94be174a475c18388c1 (diff)
downloadrails-b8646419e49f555b0cb28a27abac132542a38d6d.tar.gz
rails-b8646419e49f555b0cb28a27abac132542a38d6d.tar.bz2
rails-b8646419e49f555b0cb28a27abac132542a38d6d.zip
Merge pull request #21191 from byroot/deprecate-si-prefix
Deprecate si prefix
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/number_helper.rb2
-rw-r--r--activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb4
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