diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/date')
-rw-r--r-- | activesupport/lib/active_support/core_ext/date/calculations.rb | 6 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/date/conversions.rb | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/date/calculations.rb b/activesupport/lib/active_support/core_ext/date/calculations.rb index 59efdbd1b6..1fe4ffb8e1 100644 --- a/activesupport/lib/active_support/core_ext/date/calculations.rb +++ b/activesupport/lib/active_support/core_ext/date/calculations.rb @@ -1,3 +1,5 @@ +require 'active_support/duration' + class Date class << self # Returns a new Date representing the date 1 day ago (i.e. yesterday's date). @@ -130,7 +132,7 @@ class Date # Short-hand for years_since(1) def next_year years_since(1) - end + end unless method_defined?(:next_year) # Short-hand for months_ago(1) def last_month @@ -140,7 +142,7 @@ class Date # Short-hand for months_since(1) def next_month months_since(1) - end + end unless method_defined?(:next_month) # Returns a new Date/DateTime representing the "start" of this week (i.e, Monday; DateTime objects will have time set to 0:00) def beginning_of_week diff --git a/activesupport/lib/active_support/core_ext/date/conversions.rb b/activesupport/lib/active_support/core_ext/date/conversions.rb index f6c870035b..54facf4430 100644 --- a/activesupport/lib/active_support/core_ext/date/conversions.rb +++ b/activesupport/lib/active_support/core_ext/date/conversions.rb @@ -1,4 +1,6 @@ require 'active_support/inflector' +require 'active_support/core_ext/time/conversions' +require 'active_support/core_ext/date_time/conversions' class Date DATE_FORMATS = { |