Sha256: a409881dcbe3ee19449249d21a12983b09e1ec437ffebe8d6eef61d74ee207b5

Contents?: true

Size: 307 Bytes

Versions: 3

Compression:

Stored size: 307 Bytes

Contents

class Tag
  include Mongoid::Document
  include Mongoid::Search
  include Mongoid::Attributes::Dynamic if ::Mongoid::VERSION >= '4'

  field :name

  belongs_to :product

  def title
    name
  end

  search_in :title, product: [:name, { info: %i[summary description], category: %i[name description] }]
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongoid_search-0.4.0 spec/models/tag.rb
mongoid_search-0.3.6 spec/models/tag.rb
mongoid_search-0.3.5 spec/models/tag.rb