# File lib/thinking_sphinx/scopes.rb, line 5 def default_sphinx_scope(scope_name = nil) return @default_sphinx_scope unless scope_name @default_sphinx_scope = scope_name end
# File lib/thinking_sphinx/scopes.rb, line 11 def sphinx_scope(name, &block) sphinx_scopes[name] = block end
# File lib/thinking_sphinx/scopes.rb, line 15 def sphinx_scopes @sphinx_scopes ||= {} end
# File lib/thinking_sphinx/scopes.rb, line 21 def method_missing(method, *args, &block) return super unless sphinx_scopes.keys.include?(method) query, options = sphinx_scopes[method].call(*args) search query, (options || {}) end