Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes definition of citext in PostgreSQLAdapter

Fixes issue #62
  • Loading branch information...
commit 5928398fb95f163fd1b72776b6d6ac71c0242f6c 1 parent 0e955eb
@danmcclain danmcclain authored
View
3  lib/postgres_ext/active_record/connection_adapters/postgres_adapter.rb
@@ -127,7 +127,8 @@ def simplified_type_with_extended_types(field_type)
class PostgreSQLAdapter
class UnsupportedFeature < Exception; end
- EXTENDED_TYPES = {:inet => {:name => 'inet'}, :cidr => {:name => 'cidr'}, :macaddr => {:name => 'macaddr'}, :uuid => {:name => 'uuid'}, :citext => {:citext => 'citext'}}
+ EXTENDED_TYPES = { :inet => {:name => 'inet'}, :cidr => {:name => 'cidr'}, :macaddr => {:name => 'macaddr'},
+ :uuid => {:name => 'uuid'}, :citext => {:name => 'citext'} }
class ColumnDefinition < ActiveRecord::ConnectionAdapters::ColumnDefinition
attr_accessor :array
View
5 spec/migrations/citext_spec.rb
@@ -10,7 +10,10 @@
t.citext :citext_1
t.citext :citext_2, :citext_3
t.column :citext_4, :citext
+ t.text :citext_5
end
+
+ connection.change_column :data_types, :citext_5, :citext
end.should_not raise_exception
columns = connection.columns(:data_types)
@@ -18,10 +21,12 @@
citext_2 = columns.detect { |c| c.name == 'citext_2'}
citext_3 = columns.detect { |c| c.name == 'citext_3'}
citext_4 = columns.detect { |c| c.name == 'citext_4'}
+ citext_5 = columns.detect { |c| c.name == 'citext_5'}
citext_1.sql_type.should eq 'citext'
citext_2.sql_type.should eq 'citext'
citext_3.sql_type.should eq 'citext'
citext_4.sql_type.should eq 'citext'
+ citext_5.sql_type.should eq 'citext'
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.