aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/lib/active_support/number_helper/number_converter.rb4
-rw-r--r--activesupport/lib/active_support/number_helper/number_to_delimited_converter.rb2
-rw-r--r--activesupport/lib/active_support/number_helper/number_to_human_converter.rb4
-rw-r--r--activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb4
-rw-r--r--activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb4
5 files changed, 9 insertions, 9 deletions
diff --git a/activesupport/lib/active_support/number_helper/number_converter.rb b/activesupport/lib/active_support/number_helper/number_converter.rb
index 4bc8b4a8e7..537bf1e5b6 100644
--- a/activesupport/lib/active_support/number_helper/number_converter.rb
+++ b/activesupport/lib/active_support/number_helper/number_converter.rb
@@ -11,7 +11,7 @@ module ActiveSupport
class_attribute :namespace
# Does the object need a number that is a valid float?
- class_attribute :need_valid_float
+ class_attribute :validate_float
attr_reader :number, :opts
@@ -125,7 +125,7 @@ module ActiveSupport
def execute
return unless @number
- return @number if need_valid_float? && !valid_float?
+ return @number if validate_float? && !valid_float?
convert
end
diff --git a/activesupport/lib/active_support/number_helper/number_to_delimited_converter.rb b/activesupport/lib/active_support/number_helper/number_to_delimited_converter.rb
index 2b5dbd1d5a..6405afc9a6 100644
--- a/activesupport/lib/active_support/number_helper/number_to_delimited_converter.rb
+++ b/activesupport/lib/active_support/number_helper/number_to_delimited_converter.rb
@@ -1,7 +1,7 @@
module ActiveSupport
module NumberHelper
class NumberToDelimitedConverter < NumberConverter #:nodoc:
- self.need_valid_float = true
+ self.validate_float = true
DELIMITED_REGEX = /(\d)(?=(\d\d\d)+(?!\d))/
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 9cdc18c373..1ced75ed8a 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
@@ -5,8 +5,8 @@ module ActiveSupport
-1 => :deci, -2 => :centi, -3 => :mili, -6 => :micro, -9 => :nano, -12 => :pico, -15 => :femto }
INVERTED_DECIMAL_UNITS = DECIMAL_UNITS.invert
- self.namespace = :human
- self.need_valid_float = true
+ self.namespace = :human
+ self.validate_float = true
def convert # :nodoc:
@number = Float(@number)
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 33fc6e3553..37590c27ef 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
@@ -3,8 +3,8 @@ module ActiveSupport
class NumberToHumanSizeConverter < NumberConverter
STORAGE_UNITS = [:byte, :kb, :mb, :gb, :tb]
- self.namespace = :human
- self.need_valid_float = true
+ self.namespace = :human
+ self.validate_float = true
def convert
@number = Float(@number)
diff --git a/activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb b/activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb
index ab430bbc7a..708fb57185 100644
--- a/activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb
+++ b/activesupport/lib/active_support/number_helper/number_to_rounded_converter.rb
@@ -1,8 +1,8 @@
module ActiveSupport
module NumberHelper
class NumberToRoundedConverter < NumberConverter # :nodoc:
- self.namespace = :precision
- self.need_valid_float = true
+ self.namespace = :precision
+ self.validate_float = true
def convert
@number = Float(@number)