Module: MakeTextSearch::ConnectionAdapterHelpers

Defined in:
lib/make-text-search/schema.rb

Instance Method Summary collapse

Instance Method Details

#create_text_search_documents_table(table_name) ⇒ Object

Create the text_search_documents table



22
23
24
# File 'lib/make-text-search/schema.rb', line 22

def create_text_search_documents_table(table_name)
  text_search_adapter.create_text_search_documents_table table_name
end

#text_search_adapterObject

Returns the MakeTextSearch adapter for the current connection



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/make-text-search/schema.rb', line 8

def text_search_adapter
  @text_search_adapter ||=
    begin
      # TODO Use a list adapter
      if Adapters::PostgreSQL.is_available?(self)
        Adapters::PostgreSQL.new(self)
      else
        # TODO Generic implementation (for SQLite3, etc)
        raise NotImplementedError, "There is no adapter for #{self}"
      end
    end
end