method

ago

rails latest stable - Class: ActiveSupport::Duration
ago(time = ::Time.current)
public

Calculates a new Time or Date that is as far in the past as this Duration represents.

1Note

time is represented in the Rails app's timezone

lazylester ยท Jul 2, 2014

From the description of Time.current (which is a Rails extension of Ruby's native Time class)

"Returns Time.zone.now when Time.zone or config.time_zone are set, otherwise just returns Time.now."

so 3.days.ago, for example, is in the application's configured timezone (if it's configured).