Permalink
Browse files

Remove unneeded reliance on Numeric#round quirk

  • Loading branch information...
1 parent 74f6cce commit 816ba1e15a709337a99a931e80dddfe5bf972de5 @jeremy jeremy committed Jan 7, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 activesupport/lib/active_support/core_ext/float/rounding.rb
@@ -1,5 +1,6 @@
class Float
- remove_method :round
+ alias precisionless_round round
+ private :precisionless_round
# Rounds the float with the specified precision.
#
@@ -12,7 +13,7 @@ def round(precision = nil)
magnitude = 10.0 ** precision
(self * magnitude).round / magnitude
else
- super()
+ precisionless_round
end
end
end

0 comments on commit 816ba1e

Please sign in to comment.