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
29 30 31 32 33 34 35 |
# File 'lib/thinking_sphinx/active_record/scopes.rb', line 29 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 22 23 |
# 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| = {:classes => classes_option} .merge! block.call(*args) ThinkingSphinx::Search.new() end end end |
#sphinx_scopes ⇒ Object
25 26 27 |
# File 'lib/thinking_sphinx/active_record/scopes.rb', line 25 def sphinx_scopes @sphinx_scopes || [] end |