From d9e3a3affe949ab6a87434646cc8c3690b503b1d Mon Sep 17 00:00:00 2001 From: Alan Da Costa Date: Thu, 14 May 2009 19:27:36 -0700 Subject: [PATCH] Fix AR detection of postgres interval types with precision --- .../connection_adapters/postgresql_adapter.rb | 2 +- .../test/schema/postgresql_specific_schema.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 002696d..feb000e 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -87,7 +87,7 @@ module ActiveRecord # Date/time types when /^timestamp with(?:out)? time zone$/ :datetime - when /^interval$/ + when /^interval(?:\(\d+\))?$/ :string # Geometric types when /^(?:point|line|lseg|box|"?path"?|polygon|circle)$/ diff --git a/activerecord/test/schema/postgresql_specific_schema.rb b/activerecord/test/schema/postgresql_specific_schema.rb index 576a4d0..8223669 100644 --- a/activerecord/test/schema/postgresql_specific_schema.rb +++ b/activerecord/test/schema/postgresql_specific_schema.rb @@ -73,7 +73,7 @@ _SQL execute <<_SQL CREATE TABLE postgresql_times ( id SERIAL PRIMARY KEY, - time_interval INTERVAL + time_interval INTERVAL(0) ); _SQL -- 1.5.6.3