diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-05-30 02:29:17 -0700 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-05-30 02:47:56 -0700 |
commit | f1eddea1e3f6faf93581c43651348f48b2b7d8bb (patch) | |
tree | 32d168a6e37f1b40d0eedfedf78ad93705cdab95 /activesupport/lib | |
parent | 58d3e025793bec3a97c6f3afd8d3e36040d21167 (diff) | |
download | rails-f1eddea1e3f6faf93581c43651348f48b2b7d8bb.tar.gz rails-f1eddea1e3f6faf93581c43651348f48b2b7d8bb.tar.bz2 rails-f1eddea1e3f6faf93581c43651348f48b2b7d8bb.zip |
:scissors: removed deprecated `Numeric#ago` and friends
Replacements:
5.ago => 5.seconds.ago
5.until => 5.seconds.until
5.since => 5.seconds.since
5.from_now => 5.seconds.from_now
The removed tests does not affect coverage – we have equivalent test cases in
the tests for `AS::Duration`.
See #12389 for the history and rationale behind this.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/numeric/time.rb | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/activesupport/lib/active_support/core_ext/numeric/time.rb b/activesupport/lib/active_support/core_ext/numeric/time.rb index 704c4248d9..689fae4830 100644 --- a/activesupport/lib/active_support/core_ext/numeric/time.rb +++ b/activesupport/lib/active_support/core_ext/numeric/time.rb @@ -61,25 +61,7 @@ class Numeric end alias :fortnight :fortnights - # 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 - - # Reads best with argument: 10.minutes.until(time) - alias :until :ago - - # 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 - - # Reads best without arguments: 10.minutes.from_now - alias :from_now :since - - # Used with the standard time durations, like 1.hour.in_milliseconds -- + # Used with the standard time durations, like 1.hour.in_milliseconds -- # so we can feed them to JavaScript functions like getTime(). def in_milliseconds self * 1000 |