public
Description: Ambition adapter for Sphinx
Clone URL: git://github.com/technicalpickles/ambitious-sphinx.git
Fri Feb 29 16:19:36 -0800 2008
commit  753416af4550d0bc834f7891526e128d16c116d6
tree    04f695b5f7a0f280f6006af27dc68f599e0de575
parent  c1588c2424dbf9b47f16ef40bde58d34ce0ac6a6
ambitious-sphinx / lib / ambition / adapters / ambitious_sphinx.rb
100644 22 lines (15 sloc) 0.514 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'ambition'
 
# stub out rails stuff enough so that ultrasphinx will be happy
RAILS_ROOT = "./" unless defined? RAILS_ROOT
RAILS_ENV = "development" unless defined? RAILS_ENV
 
require 'active_record'
require 'ultrasphinx'
 
module Ambition::Adapters
  module AmbitiousSphinx
  end
end
 
%w(base page query select sort slice).each do |f|
  require "ambition/adapters/ambitious_sphinx/#{f}"
end
 
ActiveRecord::Base.extend Ambition::API
ActiveRecord::Base.ambition_adapter = Ambition::Adapters::AmbitiousSphinx