Sha256: 664dcc21215653065c9937427a14eb41d32266ade31f7b6353265135679180ab

Contents?: true

Size: 371 Bytes

Versions: 12

Compression:

Stored size: 371 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
  sphinx_scope(:ordered) { {:order => 'year DESC'} }
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
thinking-sphinx-3.4.2 spec/internal/app/models/book.rb
thinking-sphinx-3.4.1 spec/internal/app/models/book.rb
thinking-sphinx-3.4.0 spec/internal/app/models/book.rb
thinking-sphinx-3.3.0 spec/internal/app/models/book.rb
thinking-sphinx-3.2.0 spec/internal/app/models/book.rb
thinking-sphinx-3.1.4 spec/internal/app/models/book.rb
thinking-sphinx-3.1.3 spec/internal/app/models/book.rb
thinking-sphinx-3.1.2 spec/internal/app/models/book.rb
thinking-sphinx-3.1.1 spec/internal/app/models/book.rb
thinking-sphinx-3.1.0 spec/internal/app/models/book.rb
thinking-sphinx-3.0.6 spec/internal/app/models/book.rb
thinking-sphinx-3.0.5 spec/internal/app/models/book.rb