diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/date_time/conversions.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/date_time/conversions.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/date_time/conversions.rb b/activesupport/lib/active_support/core_ext/date_time/conversions.rb index 48a13e1fde..926a168cec 100644 --- a/activesupport/lib/active_support/core_ext/date_time/conversions.rb +++ b/activesupport/lib/active_support/core_ext/date_time/conversions.rb @@ -22,6 +22,11 @@ module ActiveSupport #:nodoc: def to_date ::Date.new(year, month, day) end + + # To be able to keep Times and DateTimes interchangeable on conversions + def to_datetime + self + end end end end |