Class: ThinkingSphinx::ActiveRecord::FilteredReflection

Inherits:
ActiveRecord::Reflection::AssociationReflection
  • Object
show all
Defined in:
lib/thinking_sphinx/active_record/filtered_reflection.rb

Defined Under Namespace

Classes: Filter

Class Method Summary collapse

Class Method Details

.clone_with_filter(reflection, name, class_name) ⇒ Object



57
58
59
60
61
62
63
64
65
66
# File 'lib/thinking_sphinx/active_record/filtered_reflection.rb', line 57

def self.clone_with_filter(reflection, name, class_name)
  filter = Filter.new(reflection, class_name)

  if reflection.respond_to?(:scope)
    new reflection.macro, name, filter.scope, filter.options,
      reflection.active_record
  else
    new reflection.macro, name, filter.options, reflection.active_record
  end
end