1 module ActiveSupport
#:nodoc:
2 module CoreExtensions
#:nodoc:
5 # Deprication helper methods not available as core_ext is loaded first.
7 ::ActiveSupport::Deprecation.warn(self.class.deprecated_method_warning(:years, "Fractional years are not respected. Convert value to integer before calling #years."), caller
)
8 years_without_deprecation
11 ::ActiveSupport::Deprecation.warn(self.class.deprecated_method_warning(:months, "Fractional months are not respected. Convert value to integer before calling #months."), caller
)
12 months_without_deprecation
15 def months_without_deprecation
16 ActiveSupport
::Duration.new(self * 30.days
, [[:months, self]])
20 def years_without_deprecation
21 ActiveSupport
::Duration.new(self * 365.25.days
, [[:years, self]])