diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb index c62a2447e8c67a90541d0bcb0ac9cb437e6dfdb6..3ebfa125bee0c08877ef9903e27ef82bcb526627 100644 --- a/activesupport/lib/active_support/core_ext/time/calculations.rb +++ b/activesupport/lib/active_support/core_ext/time/calculations.rb @@ -53,6 +53,16 @@ def months_since(months) end end + # Short-hand for months_ago(1) + def last_month + months_ago(1) + end + + # Short-hand for months_since(1) + def next_month + months_since(1) + end + # Returns a new Time representing the "start" of this week (Monday, 0:00) def beginning_of_week (self - self.wday.days).midnight + 1.day