Sha256: 33894a161e27b292c6535fb859db4046732344c583eb219909b127f336563140

Contents?: true

Size: 533 Bytes

Versions: 35

Compression:

Stored size: 533 Bytes

Contents

module ThinkingSphinx
  module ActiveRecord
    module HasManyAssociationWithScopes
      def method_missing(method, *args, &block)
        if responds_to_scope(method)
          @reflection.klass.
            search(:with => default_filter).
            send(method, *args, &block)
        else
          super
        end
      end
      
      private
      def responds_to_scope(scope)
        @reflection.klass.respond_to?(:sphinx_scopes)   &&
        @reflection.klass.sphinx_scopes.include?(scope)
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 3 rubygems

Version Path
thinking-sphinx-2.0.9 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-1.4.9 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-2.0.8 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-1.4.8 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-2.0.7 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-1.4.7 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-2.0.5 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-1.4.6 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
sayso-thinking-sphinx-2.0.3.002 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
sayso-thinking-sphinx-2.0.3.001 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-2.0.4 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-1.4.5 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-2.0.3 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-1.4.4 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-1.4.3 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb