mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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.
This commit is contained in:
parent
3a29bfae2c
commit
c56e314866
1 changed files with 8 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue