Sha256: dca8c230c3cff99f2deb686d895d77eac08647d3aeb5c0c68e5de2923c0d1dda
Contents?: true
Size: 569 Bytes
Versions: 19
Compression:
Stored size: 569 Bytes
Contents
class Ish::Payment include Mongoid::Document include Mongoid::Timestamps belongs_to :invoice, :class_name => 'Ish::Invoice', optional: true belongs_to :profile, :class_name => 'IshModels::UserProfile' # , :optional => true field :amount, :type => Integer # in cents field :charge, :type => Hash field :email, :type => String after_create :compute_paid_invoice_amount protected def compute_paid_invoice_amount if self.invoice self.invoice.update_attributes :paid_amount => self.invoice.paid_amount + self.amount end end end
Version data entries
19 entries across 19 versions & 1 rubygems