diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-05-18 22:02:56 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-05-18 22:02:56 +0200 |
commit | d29074af7a3da82ec4bab4f96ab802edeaa1cdb4 (patch) | |
tree | 5793361925aaf4c6dadcb47520e9e273498dff12 /activerecord | |
parent | 239f5606308a6ba11c6a591694eadc7920d4c4d1 (diff) | |
parent | d070a657c006ccbcba1b24111f1c8b21b8b9b1c9 (diff) | |
download | rails-d29074af7a3da82ec4bab4f96ab802edeaa1cdb4.tar.gz rails-d29074af7a3da82ec4bab4f96ab802edeaa1cdb4.tar.bz2 rails-d29074af7a3da82ec4bab4f96ab802edeaa1cdb4.zip |
Merge pull request #15156 from sgrif/sg-postgres-timestamps
PostgreSQL timestamps should always be datetimes
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/oid.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb index cf6a375704..a32915f363 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb @@ -204,11 +204,8 @@ This is not reliable and will be removed in the future. end end - class Timestamp < Type - def type; :timestamp; end - def simplified_type(sql_type) - :datetime - end + class DateTime < Type + def type; :datetime; end def type_cast(value) return if value.nil? @@ -483,7 +480,7 @@ This is not reliable and will be removed in the future. register_type 'bool', OID::Boolean.new register_type 'bit', OID::Bit.new alias_type 'varbit', 'bit' - register_type 'timestamp', OID::Timestamp.new + register_type 'timestamp', OID::DateTime.new alias_type 'timestamptz', 'timestamp' register_type 'date', OID::Date.new register_type 'time', OID::Time.new |