lib/thinking_sphinx/adapters/abstract_adapter.rb in pixeltrix-thinking-sphinx-1.1.5 vs lib/thinking_sphinx/adapters/abstract_adapter.rb in pixeltrix-thinking-sphinx-1.2.1

- old
+ new

@@ -14,11 +14,19 @@ when "ActiveRecord::ConnectionAdapters::MysqlAdapter", "ActiveRecord::ConnectionAdapters::MysqlplusAdapter" ThinkingSphinx::MysqlAdapter.new model when "ActiveRecord::ConnectionAdapters::PostgreSQLAdapter" ThinkingSphinx::PostgreSQLAdapter.new model + when "ActiveRecord::ConnectionAdapters::JdbcAdapter" + if model.connection.config[:adapter] == "jdbcmysql" + ThinkingSphinx::MysqlAdapter.new model + elsif model.connection.config[:adapter] == "jdbcpostgresql" + ThinkingSphinx::PostgreSQLAdapter.new model + else + raise "Invalid Database Adapter: Sphinx only supports MySQL and PostgreSQL" + end else - raise "Invalid Database Adapter: Sphinx only supports MySQL and PostgreSQL" + raise "Invalid Database Adapter: Sphinx only supports MySQL and PostgreSQL, not #{model.connection.class.name}" end end def quote_with_table(column) "#{@model.quoted_table_name}.#{@model.connection.quote_column_name(column)}"