diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-05-19 10:59:57 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-05-19 11:32:13 -0700 |
commit | d0f8c46e1962b28d77209f367f12c2d2c77f4b12 (patch) | |
tree | a20b809cd5b17c706709a51594c0ab1480503c6c /activerecord/lib/active_record/attribute_methods/read.rb | |
parent | 09cc922ed31bf699b26fafe4822fc7048b821825 (diff) | |
download | rails-d0f8c46e1962b28d77209f367f12c2d2c77f4b12.tar.gz rails-d0f8c46e1962b28d77209f367f12c2d2c77f4b12.tar.bz2 rails-d0f8c46e1962b28d77209f367f12c2d2c77f4b12.zip |
Remove :timestamp column type
The `:timestamp` type for columns is unused. All database adapters treat
them as the same database type. All code in `ActiveRecord` which changes
its behavior based on the column's type acts the same in both cases.
However, when the type is passed to code that checks for the `:datetime`
type, but not `:timestamp` (such as XML serialization), the result is
unexpected behavior.
Existing schema definitions will continue to work, and the `timestamp`
type is transparently aliased to `datetime`.
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods/read.rb')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/read.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb index d01e9aea59..979dfb207e 100644 --- a/activerecord/lib/active_record/attribute_methods/read.rb +++ b/activerecord/lib/active_record/attribute_methods/read.rb @@ -35,7 +35,7 @@ module ActiveRecord extend ActiveSupport::Concern - ATTRIBUTE_TYPES_CACHED_BY_DEFAULT = [:datetime, :timestamp, :time, :date] + ATTRIBUTE_TYPES_CACHED_BY_DEFAULT = [:datetime, :time, :date] included do class_attribute :attribute_types_cached_by_default, instance_writer: false @@ -52,7 +52,7 @@ module ActiveRecord end # Returns the attributes which are cached. By default time related columns - # with datatype <tt>:datetime, :timestamp, :time, :date</tt> are cached. + # with datatype <tt>:datetime, :time, :date</tt> are cached. def cached_attributes @cached_attributes ||= columns.select { |c| cacheable_column?(c) }.map { |col| col.name }.to_set end |