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



51
52
53
54
# File 'lib/phat_pgsearch/postgresql.rb', line 51

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



57
58
59
60
61
# File 'lib/phat_pgsearch/postgresql.rb', line 57

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