Sha256: 58eaeb5cd68032d2409111ac7438494cacc6cc8001e1e1ec1a1bb766b549f7e2

Contents?: true

Size: 611 Bytes

Versions: 9

Compression:

Stored size: 611 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
  field :title, localize: :present
  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

9 entries across 9 versions & 1 rubygems

Version Path
mongoid-8.1.8 spec/support/models/product.rb
mongoid-8.1.7 spec/support/models/product.rb
mongoid-8.1.6 spec/support/models/product.rb
mongoid-8.1.5 spec/support/models/product.rb
mongoid-8.1.4 spec/support/models/product.rb
mongoid-8.1.3 spec/support/models/product.rb
mongoid-8.1.2 spec/support/models/product.rb
mongoid-8.1.1 spec/support/models/product.rb
mongoid-8.1.0 spec/support/models/product.rb