Feb 15, 2010
Rails
Thinking Sphinx
Solution for undefined method `sphinx_scope'
Running into undefined_method errors with Thinking Sphinx and sphinx scopes?
Make sure you define your sphinx_scope after the define_index block, instead of before.
Simple, huh?
In other words, make sure your ActiveRecord classes look like this:
class ContrivedExample < ActiveRecord::Base
define_index do
has :something
end
sphinx_scope(:something_cool) { :with => {:something => 10} }
end