Module: PhatPgsearch::PostgreSQL::TableDefinition

Defined in:
lib/phat_pgsearch/postgresql.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



47
48
49
50
# File 'lib/phat_pgsearch/postgresql.rb', line 47

def self.included(base)
  # add data type
  ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:tsvector] = {:name => "tsvector"}
end

Instance Method Details

#tsvector(*args) ⇒ Object

add tsvector column



53
54
55
56
57
# File 'lib/phat_pgsearch/postgresql.rb', line 53

def tsvector(*args)
  options = args.extract_options!
  column_names = args
  column_names.each { |name| column(name, :tsvector, options) }
end