Sha256: 7d8be4069b060d4ab9622adc94ffc63c5ab4912ca63378797730d1bbcd448768
Contents?: true
Size: 623 Bytes
Versions: 17
Compression:
Stored size: 623 Bytes
Contents
## ## Not used. _vp_ 2023-09-07 ## Just replicating the Stripe structure. ## class Wco::Price include Mongoid::Document include Mongoid::Timestamps belongs_to :product, class_name: '::Wco::Product', inverse_of: :prices has_many :subscriptions, class_name: '::Wco::Subscription', inverse_of: :price, foreign_key: :wco_price_id field :amount_cents, type: Integer INTERVALS = [ nil, 'day', 'week', 'month', 'year' ] field :interval, type: String field :price_id # stripe def name "$#{ amount_cents.to_f/100 } / #{interval}" end def name_simple "$#{ amount_cents.to_f/100 }" end end
Version data entries
17 entries across 17 versions & 1 rubygems