find total months passed between two ActiveSupport::TimeWithZone objects

unit.created_at.class

=> ActiveSupport::TimeWithZone

Time.zone.now.class

=> ActiveSupport::TimeWithZone

Time.zone.now - unit.created_at

=> 47709736.32316899

I think that’s the number of seconds that have passed between when the unit was created and the current time. Is this correct? If so, is there any easier way to find the total months that passed between two time objects like this?

(Time.zone.now - unit.created_at) / 1.month, perhaps?

–Matt Jones