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 | 7 |
1 files changed, 7 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 1b78a72eea..ce0bfd8e0a 100644 --- a/activesupport/lib/active_support/core_ext/date_time/conversions.rb +++ b/activesupport/lib/active_support/core_ext/date_time/conversions.rb @@ -6,6 +6,8 @@ module ActiveSupport #:nodoc: def self.included(klass) klass.send(:alias_method, :to_datetime_default_s, :to_s) klass.send(:alias_method, :to_s, :to_formatted_s) + klass.send(:alias_method, :default_inspect, :inspect) + klass.send(:alias_method, :inspect, :readable_inspect) end def to_formatted_s(format = :default) @@ -19,6 +21,11 @@ module ActiveSupport #:nodoc: to_datetime_default_s end end + + # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005 14:30:00 +0000" + def readable_inspect + to_s(:rfc822) + end # Converts self to a Ruby Date object; time portion is discarded def to_date |