Calculating the end of the month, x months ago, with Rails
Last day of month, 12 months ago:
(Time.now.beginning_of_month - 12.months).end_of_month
Rails' "months.ago" is intelligent enough to use exact amount of days.
Last day of month, 12 months ago:
(Time.now.beginning_of_month - 12.months).end_of_month
Rails' "months.ago" is intelligent enough to use exact amount of days.