提交 70811064 编写于 作者: J Jean Boussier

Deprecate the :prefix option of `number_to_human_size`

上级 8adf25a6
......@@ -220,8 +220,6 @@ def number_to_rounded(number, options = {})
# * <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
#
......
......@@ -7,6 +7,10 @@ class NumberToHumanSizeConverter < NumberConverter #:nodoc:
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册