aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorAkshay Vishnoi <akshay.vishnoi@vinsol.com>2015-12-19 12:23:45 +0530
committerAkshay Vishnoi <akshay.vishnoi@vinsol.com>2015-12-29 17:03:36 +0530
commit007bb117c19d4a7c8119474c9897487e81cd4cd3 (patch)
tree275f88fdbc1a0c6c8baa20c567d6acb6b2766f9f /activesupport/lib/active_support
parent468df261f8a123dec1d36b22136476ae3660e1fa (diff)
downloadrails-007bb117c19d4a7c8119474c9897487e81cd4cd3.tar.gz
rails-007bb117c19d4a7c8119474c9897487e81cd4cd3.tar.bz2
rails-007bb117c19d4a7c8119474c9897487e81cd4cd3.zip
Fix - to_s(:db) on Numeric range
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/numeric/conversions.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/numeric/conversions.rb b/activesupport/lib/active_support/core_ext/numeric/conversions.rb
index 35416c3e29..9d832897ed 100644
--- a/activesupport/lib/active_support/core_ext/numeric/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/numeric/conversions.rb
@@ -120,7 +120,11 @@ module ActiveSupport::NumericWithFormat
when :human_size
return ActiveSupport::NumberHelper.number_to_human_size(self, options)
else
- super
+ if is_a?(Float) || format.is_a?(Symbol)
+ super()
+ else
+ super
+ end
end
end