Sha256: 9a0d8455cacac226db1ee21d1719b6d9b9d85e60e5fa2bd68e8f0545fbb497a3

Contents?: true

Size: 578 Bytes

Versions: 1

Compression:

Stored size: 578 Bytes

Contents

class FilteredArtwork
  include Mongoid::Document
  include Mongoid::FullTextSearch
  field :title, type: String
  field :colors, type: Array, default: []
  fulltext_search_in :title, :index_name => 'mongoid_fulltext.artworks_and_artists',
                     :filters => { :is_foobar => lambda { |x| x.title == 'foobar' },
                                   :is_artwork => lambda { |x| true },
                                   :is_artist => lambda { |x| false },
                                   :colors? => lambda { |x| x.colors }
                                  }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongoid_fulltext-0.5.8 spec/models/filtered_artwork.rb