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
friendlyfashion-thinking-sphinx-2.0.14.4 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
friendlyfashion-thinking-sphinx-2.0.14.3 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-2.1.0 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-1.5.0 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
friendlyfashion-thinking-sphinx-2.0.14.2 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
friendlyfashion-thinking-sphinx-2.0.14.1 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-2.0.14 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-1.4.14 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
friendlyfashion-thinking-sphinx-2.0.13.3 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
friendlyfashion-thinking-sphinx-2.0.13.2 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
friendlyfashion-thinking-sphinx-2.0.13.1 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
friendlyfashion-thinking-sphinx-2.0.13 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-2.0.13 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-1.4.13 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-2.0.12 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-1.4.12 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-2.0.11 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-1.4.11 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-2.0.10 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
thinking-sphinx-1.4.10 lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb