def sphinx_scope(method, &block)
add_sphinx_scopes_support_to_has_many_associations
@sphinx_scopes ||= []
@sphinx_scopes << method
singleton_class.instance_eval do
define_method(method) do |*args|
options = {:classes => classes_option}
options.merge! block.call(*args)
ThinkingSphinx::Search.new(options)
end
define_method("#{method}_without_default".to_sym) do |*args|
options = {:classes => classes_option, :ignore_default => true}
options.merge! block.call(*args)
ThinkingSphinx::Search.new(options)
end
end
end