Sha256: 1c7f34121fb248fda3236a6b2a0541a456ca63e277a650c88f753fd71af718c0

Contents?: true

Size: 318 Bytes

Versions: 6

Compression:

Stored size: 318 Bytes

Contents

class Book < ActiveRecord::Base
  include ThinkingSphinx::Scopes

  has_and_belongs_to_many :genres

  sphinx_scope(:by_query) { |query| query }
  sphinx_scope(:by_year) do |year|
    {:with => {:year => year}}
  end
  sphinx_scope(:by_query_and_year) do |query, year|
    [query, {:with => {:year =>year}}]
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
thinking-sphinx-3.0.4 spec/internal/app/models/book.rb
thinking-sphinx-3.0.3 spec/internal/app/models/book.rb
thinking-sphinx-3.0.2 spec/internal/app/models/book.rb
thinking-sphinx-3.0.1 spec/internal/app/models/book.rb
thinking-sphinx-3.0.0 spec/internal/app/models/book.rb
thinking-sphinx-3.0.0.rc spec/internal/app/models/book.rb