Module: ThinkingSphinx::ActiveRecord::Scopes::ClassMethods
- Defined in:
- lib/thinking_sphinx/active_record/scopes.rb
Instance Method Summary collapse
Instance Method Details
#remove_sphinx_scopes ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/thinking_sphinx/active_record/scopes.rb', line 27 def remove_sphinx_scopes sphinx_scopes.each do |scope| .send(:undef_method, scope) end sphinx_scopes.clear end |
#sphinx_scope(method, &block) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/thinking_sphinx/active_record/scopes.rb', line 11 def sphinx_scope(method, &block) @sphinx_scopes ||= [] @sphinx_scopes << method .instance_eval do define_method(method) do |*args| = block.call(*args) ThinkingSphinx::Search.new() end end end |
#sphinx_scopes ⇒ Object
23 24 25 |
# File 'lib/thinking_sphinx/active_record/scopes.rb', line 23 def sphinx_scopes @sphinx_scopes || [] end |