diff options
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/numeric/time.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/numeric/time.rb b/activesupport/lib/active_support/core_ext/numeric/time.rb index d97ce938c1..704c4248d9 100644 --- a/activesupport/lib/active_support/core_ext/numeric/time.rb +++ b/activesupport/lib/active_support/core_ext/numeric/time.rb @@ -63,6 +63,7 @@ class Numeric # Reads best without arguments: 10.minutes.ago def ago(time = ::Time.current) + ActiveSupport::Deprecation.warn "Calling #ago or #until on a number (e.g. 5.ago) is deprecated and will be removed in the future, use 5.seconds.ago instead" time - self end @@ -71,6 +72,7 @@ class Numeric # Reads best with argument: 10.minutes.since(time) def since(time = ::Time.current) + ActiveSupport::Deprecation.warn "Calling #since or #from_now on a number (e.g. 5.since) is deprecated and will be removed in the future, use 5.seconds.since instead" time + self end |