Sha256: e25e62de1c94911bdd181a78859d3e763a24f93c28c176efafe65044df4bf597

Contents?: true

Size: 411 Bytes

Versions: 2

Compression:

Stored size: 411 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, :description],
            :subproducts => [:brand, :name], :info => [ :summary, :description ]
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongoid_search-0.3.2 spec/models/product.rb
mongoid_search-0.3.1 spec/models/product.rb