Class: ThinkingSphinx::AbstractAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/thinking_sphinx/adapters/abstract_adapter.rb

Direct Known Subclasses

MysqlAdapter, PostgreSQLAdapter

Class Method Summary collapse

Class Method Details

.detect(model) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/thinking_sphinx/adapters/abstract_adapter.rb', line 9

def detect(model)
  case model.connection.class.name
  when "ActiveRecord::ConnectionAdapters::MysqlAdapter"
    ThinkingSphinx::MysqlAdapter
  when "ActiveRecord::ConnectionAdapters::PostgreSQLAdapter"
    ThinkingSphinx::PostgreSQLAdapter
  else
    raise "Invalid Database Adapter: Sphinx only supports MySQL and PostgreSQL"
  end
end

.setupObject



4
5
6
7
# File 'lib/thinking_sphinx/adapters/abstract_adapter.rb', line 4

def setup
  # Deliberately blank - subclasses should do something though. Well, if
  # they need to.
end