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:
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)
|
||||
|
Loading…
Reference in New Issue
Block a user