Sha256: 5108b5ec8ba5aec6c0be65ad29f2ef1fd405175a83fa93db7cc0e853df882360

Contents?: true

Size: 960 Bytes

Versions: 34

Compression:

Stored size: 960 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
  # 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.order_by({ name: :asc }).map { |i| [i.name, i.id] }
  end

end









  ## @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

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
ish_models-3.0.0.1 lib/wco/product.rb
ish_models-0.0.33.304 lib/wco/product.rb
ish_models-0.0.33.303 lib/wco/product.rb
ish_models-0.0.33.302 lib/wco/product.rb
ish_models-0.0.33.301 lib/wco/product.rb
ish_models-0.0.33.300 lib/wco/product.rb
ish_models-0.0.33.299 lib/wco/product.rb
ish_models-0.0.33.298 lib/wco/product.rb
ish_models-0.0.33.297 lib/wco/product.rb
ish_models-0.0.33.296 lib/wco/product.rb
ish_models-0.0.33.295 lib/wco/product.rb
ish_models-0.0.33.294 lib/wco/product.rb
ish_models-0.0.33.293 lib/wco/product.rb
ish_models-0.0.33.292 lib/wco/product.rb
ish_models-0.0.33.291 lib/wco/product.rb
ish_models-0.0.33.287 lib/wco/product.rb
ish_models-0.0.33.286 lib/wco/product.rb
ish_models-0.0.33.285 lib/wco/product.rb
ish_models-0.0.33.284 lib/wco/product.rb
ish_models-0.0.33.283 lib/wco/product.rb