instance method
ago
Ruby on Rails 4.2.9
Since v2.2.3Signature
ago(time = ::Time.current)
Calculates a new Time or Date that is as far in the past as this Duration represents.
Parameters
-
timeopt = ::Time.current
Source
# File activesupport/lib/active_support/duration.rb, line 108
def ago(time = ::Time.current)
sum(-1, time)
end
Defined in activesupport/lib/active_support/duration.rb line 108
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Duration