Sha256: 5615b7ba90d2e7ab4bc2ce313caf4972d1649414c3c3b8eb348ebd22ce7dd3ab
Contents?: true
Size: 451 Bytes
Versions: 21
Compression:
Stored size: 451 Bytes
Contents
module TxCatcher class Deposit < Sequel::Model many_to_one :transaction many_to_one :address attr_accessor :address_string def before_save if @address_string self.address = Address.find_or_create(address: @address_string) end self.address.update(received: self.address.received + self.amount) end def amount_in_btc Satoshi.new(self.amount, from_unit: :satoshi).to_btc end end end
Version data entries
21 entries across 21 versions & 1 rubygems