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