diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/date_time')
-rw-r--r-- | activesupport/lib/active_support/core_ext/date_time/conversions.rb | 12 |
1 files changed, 7 insertions, 5 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 ce0bfd8e0a..91ed0e94e9 100644 --- a/activesupport/lib/active_support/core_ext/date_time/conversions.rb +++ b/activesupport/lib/active_support/core_ext/date_time/conversions.rb @@ -3,11 +3,13 @@ module ActiveSupport #:nodoc: module DateTime #:nodoc: # Getting datetimes in different convenient string representations and other objects module Conversions - 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) + def self.included(base) + base.class_eval do + alias_method :to_datetime_default_s, :to_s + alias_method :to_s, :to_formatted_s + alias_method :default_inspect, :inspect + alias_method :inspect, :readable_inspect + end end def to_formatted_s(format = :default) |