Sha256: 5b4234cb1b31f2fee16870798b0d37f0c47fac3b39f0a4522131ca58237aea08

Contents?: true

Size: 416 Bytes

Versions: 56

Compression:

Stored size: 416 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 self.list
    [ [nil,nil] ] + self.all.order_by({ name: :asc }).map { |i| [i.name, i.id] }
  end

end


Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
wco_models-3.1.0.95 app/models/wco/product.rb
wco_models-3.1.0.94 app/models/wco/product.rb
wco_models-3.1.0.93 app/models/wco/product.rb
wco_models-3.1.0.92 app/models/wco/product.rb
wco_models-3.1.0.91 app/models/wco/product.rb
wco_models-3.1.0.90 app/models/wco/product.rb
wco_models-3.1.0.89 app/models/wco/product.rb
wco_models-3.1.0.88 app/models/wco/product.rb
wco_models-3.1.0.87 app/models/wco/product.rb
wco_models-3.1.0.86 app/models/wco/product.rb
wco_models-3.1.0.85 app/models/wco/product.rb
wco_models-3.1.0.83 app/models/wco/product.rb
wco_models-3.1.0.82 app/models/wco/product.rb
wco_models-3.1.0.81 app/models/wco/product.rb
wco_models-3.1.0.80 app/models/wco/product.rb
wco_models-3.1.0.79 app/models/wco/product.rb
wco_models-3.1.0.78 app/models/wco/product.rb
wco_models-3.1.0.77 app/models/wco/product.rb
wco_models-3.1.0.76 app/models/wco/product.rb
wco_models-3.1.0.75 app/models/wco/product.rb