From 7063e254bf2a24cda7d7f3e07ba50ac1b44a8d2f Mon Sep 17 00:00:00 2001 From: schneems Date: Fri, 9 May 2014 11:50:35 -0500 Subject: [ci skip] doc ActiveSupport::TimeWithZone#to_s Current docs are wrong. Does not accept strftime inputs. --- activesupport/lib/active_support/time_with_zone.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index c25c97cfa8..f2a2f3c3db 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -185,8 +185,11 @@ module ActiveSupport end alias_method :rfc822, :rfc2822 - # :db format outputs time in UTC; all others output time in local. - # Uses TimeWithZone's +strftime+, so %Z and %z work correctly. + # Returns a string of the object's date and time. + # Accepts an optional format: + # * :default - default value, mimics Ruby 1.9 Time#to_s format. + # * :db - format outputs time in UTC :db time. See Time#to_formatted_s(:db). + # * Any key in Time::DATE_FORMATS can be used. See active_support/core_ext/time/conversions.rb. def to_s(format = :default) if format == :db utc.to_s(format) -- cgit v1.2.3