mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 08:52:04 +02:00
Import account balance #2267
This commit is contained in:
parent
392ecba4b2
commit
e6387a2847
3 changed files with 20 additions and 0 deletions
5
app/models/legacy/invoice.rb
Normal file
5
app/models/legacy/invoice.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
module Legacy
|
||||
class Invoice < Db
|
||||
self.table_name = :invoice
|
||||
end
|
||||
end
|
|
@ -1,5 +1,11 @@
|
|||
module Legacy
|
||||
class Registrar < Db
|
||||
self.table_name = :registrar
|
||||
|
||||
has_many :invoices, foreign_key: :registrarid
|
||||
|
||||
def account_balance
|
||||
invoices.sum(:credit)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue