Sha256: ee7157a5c319ef061f4faa3a9fd74d091a108d5b144589dca27ddeb7c04f574d

Contents?: true

Size: 929 Bytes

Versions: 2

Compression:

Stored size: 929 Bytes

Contents

class Wco::Product
  include Mongoid::Document
  include Mongoid::Timestamps

  field :name

  field :product_id # stripe

  ## @TODO: remove, interval makes no sense on product! replace with Wco::Price . _vp_ 2023-09-07
  # INTERVALS = [ nil, 'day', 'week', 'month', 'year' ]
  # field :interval, type: String

  ## @TODO: remove, interval makes no sense on product! replace with Wco::Price . _vp_ 2023-09-07
  # field :price_id   # stripe

  ## @TODO: remove, interval makes no sense on product! replace with Wco::Price . _vp_ 2023-09-07
  # field :price_cents, type: Integer

  ## @TODO: remove, interval makes no sense on product! replace with Wco::Price . _vp_ 2023-09-07
  # has_many :subscriptions, class_name: '::Wco::Subscription', inverse_of: :subscription

  has_many :prices,        class_name: '::Wco::Price', inverse_of: :product

  def self.list
    [ [nil,nil] ] + self.all.map { |i| [i.name, i.id] }
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ish_models-0.0.33.268 lib/wco/product.rb
ish_models-0.0.33.267 lib/wco/product.rb