Merge pull request #27185 from kamipo/fix_apply_seconds_precision

Fix `apply_seconds_precision` not to be affected by `mathn`
This commit is contained in:
Sean Griffin 2016-12-08 13:04:39 -05:00 committed by GitHub
commit 55ebf6c1ac

@ -34,7 +34,7 @@ def apply_seconds_precision(value)
return value unless precision && value.respond_to?(:usec)
number_of_insignificant_digits = 6 - precision
round_power = 10**number_of_insignificant_digits
value.change(usec: value.usec / round_power * round_power)
value.change(usec: value.usec - value.usec % round_power)
end
def type_cast_for_schema(value)