Fix warning in Rubies that already have the method
This commit is contained in:
parent
45a1bcea9b
commit
0b72dd37c1
@ -6,6 +6,7 @@
|
||||
require "active_support/core_ext/time/zones"
|
||||
require "active_support/core_ext/date_and_time/calculations"
|
||||
require "active_support/core_ext/date/calculations"
|
||||
require "active_support/core_ext/module/remove_method"
|
||||
|
||||
class Time
|
||||
include DateAndTime::Calculations
|
||||
@ -116,6 +117,7 @@ def floor(precision = 0)
|
||||
# Restricted Ruby version due to a bug in `Time#ceil`
|
||||
# See https://bugs.ruby-lang.org/issues/17025 for more details
|
||||
if RUBY_VERSION <= "2.7.1"
|
||||
remove_possible_method :ceil
|
||||
def ceil(precision = 0)
|
||||
change(nsec: 0) + subsec.ceil(precision)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user