Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #14859 from jefflai2/datetime_type

PostgreSQL Timestamps always map to `:datetime`.
  • Loading branch information...
commit 10ed70185a664b34c1177c24b7ab06cd74502183 2 parents a5db212 + d080e8c
@senny senny authored
View
14 activerecord/CHANGELOG.md
@@ -1,3 +1,17 @@
+* PostgreSQL should internally use `:datetime` consistently for TimeStamp. Assures
+ different spellings of timestamps are treated the same.
+
+ Example:
+
+ mytimestamp.simplified_type('timestamp without time zone')
+ # => :datetime
+ mytimestamp.simplified_type('timestamp(6) without time zone')
+ # => also :datetime (previously would be :timestamp)
+
+ See #14513.
+
+ *Jefferson Lai*
+
* `ActiveRecord::Base.no_touching` no longer triggers callbacks or start empty transactions.
Fixes #14841.
View
7 activerecord/lib/active_record/connection_adapters/postgresql/oid.rb
@@ -209,12 +209,7 @@ def type_cast(value)
class Timestamp < Type
def type; :timestamp; end
def simplified_type(sql_type)
- case sql_type
- when /^timestamp with(?:out)? time zone$/
- :datetime
- else
- :timestamp
- end
+ :datetime
end
def type_cast(value)
Please sign in to comment.
Something went wrong with that request. Please try again.