diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-26 08:52:37 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-26 08:52:37 -0700 |
commit | 6e02a61f3954ba98ad0c3c36e5898a4650e6e468 (patch) | |
tree | 1f32518b6b27d041d11b8afcb5f607d97e05ddfa /activerecord/lib | |
parent | a5b0f7064c0b74f4e007d8536afb8976d10fd49d (diff) | |
parent | 714b4a82f43e3882516e81e8fac8da34e72b190e (diff) | |
download | rails-6e02a61f3954ba98ad0c3c36e5898a4650e6e468.tar.gz rails-6e02a61f3954ba98ad0c3c36e5898a4650e6e468.tar.bz2 rails-6e02a61f3954ba98ad0c3c36e5898a4650e6e468.zip |
Merged pull request #310 from beanieboi/master.
Added support for tsvector datatype in postgres
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index e2b9a5d0d9..0c2afc180b 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -98,6 +98,9 @@ module ActiveRecord # XML type when 'xml' :xml + # tsvector type + when 'tsvector' + :tsvector # Arrays when /^\D+\[\]$/ :string @@ -189,6 +192,11 @@ module ActiveRecord options = args.extract_options! column(args[0], 'xml', options) end + + def tsvector(*args) + options = args.extract_options! + column(args[0], 'tsvector', options) + end end ADAPTER_NAME = 'PostgreSQL' @@ -206,7 +214,8 @@ module ActiveRecord :date => { :name => "date" }, :binary => { :name => "bytea" }, :boolean => { :name => "boolean" }, - :xml => { :name => "xml" } + :xml => { :name => "xml" }, + :tsvector => { :name => "tsvector" } } # Returns 'PostgreSQL' as adapter name for identification purposes. |