Permalink
Browse files

Updates to ActiveRecord::Timestamp documentation.

Change ActiveRecord::Base.xyz to config.active_record.xyz in docs.

Remove <tt> from code samples.

Update skip_time_zone_conversion_for_attributes code sample: put the call in the model class.

Clarify that skip_time_zone_conversion_for_attributes skips converion when reading.
  • Loading branch information...
1 parent 3a29bfa commit c56e314866dff5d72c2a90e5e785c9a12d73d22b Brian Morearty committed Feb 5, 2011
Showing with 8 additions and 6 deletions.
  1. +8 −6 activerecord/lib/active_record/timestamp.rb
@@ -9,24 +9,26 @@ module ActiveRecord
#
# Timestamping can be turned off by setting:
#
- # <tt>ActiveRecord::Base.record_timestamps = false</tt>
+ # config.active_record.record_timestamps = false
#
# Timestamps are in the local timezone by default but you can use UTC by setting:
#
- # <tt>ActiveRecord::Base.default_timezone = :utc</tt>
+ # config.active_record.default_timezone = :utc
#
# == Time Zone aware attributes
#
# By default, ActiveRecord::Base keeps all the datetime columns time zone aware by executing following code.
#
- # ActiveRecord::Base.time_zone_aware_attributes = true
+ # config.active_record.time_zone_aware_attributes = true
#
# This feature can easily be turned off by assigning value <tt>false</tt> .
#
- # If your attributes are time zone aware and you desire to skip time zone conversion for certain
- # attributes then you can do following:
+ # If your attributes are time zone aware and you desire to skip time zone conversion to the current Time.zone
+ # when reading certain attributes then you can do following:
#
- # Topic.skip_time_zone_conversion_for_attributes = [:written_on]
+ # class Topic < ActiveRecord::Base
+ # self.skip_time_zone_conversion_for_attributes = [:written_on]
+ # end
module Timestamp
extend ActiveSupport::Concern

0 comments on commit c56e314

Please sign in to comment.