1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #15156 from sgrif/sg-postgres-timestamps

PostgreSQL timestamps should always be datetimes
This commit is contained in:
Yves Senn 2014-05-18 22:02:56 +02:00
commit d29074af7a

View file

@ -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