diff options
author | Brian Morearty <github2@morearty.org> | 2011-02-05 09:07:00 -0800 |
---|---|---|
committer | Brian Morearty <github2@morearty.org> | 2011-02-05 09:07:00 -0800 |
commit | c56e314866dff5d72c2a90e5e785c9a12d73d22b (patch) | |
tree | 8e7fe29f5adc0548347710963a55889e840b2711 /activerecord/lib/active_record | |
parent | 3a29bfae2cbb956e469942ed1d4ea8c702085a1a (diff) | |
download | rails-c56e314866dff5d72c2a90e5e785c9a12d73d22b.tar.gz rails-c56e314866dff5d72c2a90e5e785c9a12d73d22b.tar.bz2 rails-c56e314866dff5d72c2a90e5e785c9a12d73d22b.zip |
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.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/timestamp.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/timestamp.rb b/activerecord/lib/active_record/timestamp.rb index 65d9d1fb19..1511c71ffc 100644 --- a/activerecord/lib/active_record/timestamp.rb +++ b/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 |