Sha256: fe019670ba8c9858d1ec031fd8bcebb16cbe1c67e105dae2332a1dcf4ec12ede

Contents?: true

Size: 441 Bytes

Versions: 84

Compression:

Stored size: 441 Bytes

Contents

class Wco::Product
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::Paranoia
  store_in collection: 'wco_products'

  field :name

  field :product_id # stripe

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

  has_many :subscriptions, as: :product

  def to_s
    name
  end
  def self.list
    [ [nil,nil] ] + self.all.order_by({ name: :asc }).map { |i| [i.name, i.id] }
  end
end


Version data entries

84 entries across 84 versions & 1 rubygems

Version Path
wco_models-3.1.0.139 app/models/wco/product.rb
wco_models-3.1.0.138 app/models/wco/product.rb
wco_models-3.1.0.137 app/models/wco/product.rb
wco_models-3.1.0.136 app/models/wco/product.rb
wco_models-3.1.0.135 app/models/wco/product.rb
wco_models-3.1.0.134 app/models/wco/product.rb
wco_models-3.1.0.133 app/models/wco/product.rb
wco_models-3.1.0.132 app/models/wco/product.rb
wco_models-3.1.0.131 app/models/wco/product.rb
wco_models-3.1.0.130 app/models/wco/product.rb
wco_models-3.1.0.129 app/models/wco/product.rb
wco_models-3.1.0.128 app/models/wco/product.rb
wco_models-3.1.0.127 app/models/wco/product.rb
wco_models-3.1.0.126 app/models/wco/product.rb
wco_models-3.1.0.125 app/models/wco/product.rb
wco_models-3.1.0.124 app/models/wco/product.rb
wco_models-3.1.0.123 app/models/wco/product.rb
wco_models-3.1.0.122 app/models/wco/product.rb
wco_models-3.1.0.121 app/models/wco/product.rb
wco_models-3.1.0.120 app/models/wco/product.rb