Sha256: 38129f8f29c20a3f60657573f6d2455a3aa30c1790927fa109ccfd3ebd2e6231

Contents?: true

Size: 576 Bytes

Versions: 16

Compression:

Stored size: 576 Bytes

Contents

# frozen_string_literal: true

class Product
  include Mongoid::Document
  field :description, localize: true
  field :name, localize: true, default: "no translation"
  field :price, type: Integer
  field :brand_name
  field :stores, type: Array
  field :website, localize: true
  field :sku, as: :stock_keeping_unit
  field :tl, as: :tagline, localize: true
  alias_attribute :cost, :price

  validates :name, presence: true
  validates :website, format: { with: URI.regexp, allow_blank: true }

  embeds_one :seo, as: :seo_tags, cascade_callbacks: true, autobuild: true
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mongoid-8.0.8 spec/support/models/product.rb
mongoid-8.0.7 spec/support/models/product.rb
mongoid-8.0.6 spec/support/models/product.rb
mongoid-7.5.4 spec/support/models/product.rb
mongoid-8.0.5 spec/support/models/product.rb
mongoid-7.5.3 spec/support/models/product.rb
mongoid-8.0.4 spec/support/models/product.rb
mongoid-8.0.3 spec/support/models/product.rb
mongoid-7.5.2 spec/support/models/product.rb
mongoid-8.0.2 spec/support/models/product.rb
mongoid-7.5.1 spec/support/models/product.rb
mongoid-7.4.3 spec/support/models/product.rb
mongoid-8.0.1 spec/support/models/product.rb
mongoid-7.5.0 spec/support/models/product.rb
mongoid-7.4.1 spec/support/models/product.rb
mongoid-7.4.0 spec/support/models/product.rb