Add account after registrar create

This commit is contained in:
Martin Lensment 2015-05-25 13:32:27 +03:00
parent c1211a0ac5
commit f7a4dee1b6
5 changed files with 16 additions and 4 deletions

View file

@ -53,6 +53,11 @@ class Registrar < ActiveRecord::Base
whois_records.map(&:save) # slow currently
end
after_create :create_cash_account
def create_cash_account
accounts.create(account_type: Account::CASH, currency: 'EUR')
end
class << self
def search_by_query(query)
res = search(name_or_reg_no_cont: query).result