Sha256: b4bf2a1438841aed6b1c674c27c00859956c8811f373ab2ed33b544a9989aa51

Contents?: true

Size: 395 Bytes

Versions: 1

Compression:

Stored size: 395 Bytes

Contents

class Product
  include Mongoid::Document
  include Mongoid::Search
  field :brand
  field :name
  field :attrs, :type => Array
  field :info, :type => Hash

  has_many    :tags
  belongs_to  :category
  embeds_many :subproducts

  search_in :brand, :name, :outlet, :attrs, :tags => :name, :category => :name,
            :subproducts => [:brand, :name], :info => [ :summary, :description ]
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongoid_search-0.3.0 spec/models/product.rb