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.187 app/models/wco/product.rb
wco_models-3.1.0.184 app/models/wco/product.rb
wco_models-3.1.0.183 app/models/wco/product.rb
wco_models-3.1.0.182 app/models/wco/product.rb
wco_models-3.1.0.181 app/models/wco/product.rb
wco_models-3.1.0.180 app/models/wco/product.rb
wco_models-3.1.0.178 app/models/wco/product.rb
wco_models-3.1.0.177 app/models/wco/product.rb
wco_models-3.1.0.176 app/models/wco/product.rb
wco_models-3.1.0.175 app/models/wco/product.rb
wco_models-3.1.0.174 app/models/wco/product.rb
wco_models-3.1.0.173 app/models/wco/product.rb
wco_models-3.1.0.172 app/models/wco/product.rb
wco_models-3.1.0.171 app/models/wco/product.rb
wco_models-3.1.0.170 app/models/wco/product.rb
wco_models-3.1.0.169 app/models/wco/product.rb
wco_models-3.1.0.168 app/models/wco/product.rb
wco_models-3.1.0.167 app/models/wco/product.rb
wco_models-3.1.0.166 app/models/wco/product.rb
wco_models-3.1.0.165 app/models/wco/product.rb