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



65
66
67
68
69
70
71
72
73
74
# File 'lib/thinking_sphinx/active_record/filtered_reflection.rb', line 65

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