Sha256: c36b0038cbb04faad6cc91a7ad220bdc8d1a574c0d9844948f40193e142af3a8
Contents?: true
Size: 479 Bytes
Versions: 23
Compression:
Stored size: 479 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 CryptoUnit.new(Config["currency"], self.amount, from_unit: :primary).to_standart end end end
Version data entries
23 entries across 23 versions & 1 rubygems