Module: ErpTxnsAndAccts::Extensions::ActiveRecord::ActsAsBizTxnAccount::InstanceMethods

Defined in:
lib/erp_txns_and_accts/extensions/active_record/acts_as_biz_txn_account.rb

Instance Method Summary collapse

Instance Method Details

#account_root ⇒ Object



39
40
41
# File 'lib/erp_txns_and_accts/extensions/active_record/acts_as_biz_txn_account.rb', line 39

def 
  biz_txn_acct_root
end

#destroy_biz_txn_account ⇒ Object



55
56
57
# File 'lib/erp_txns_and_accts/extensions/active_record/acts_as_biz_txn_account.rb', line 55

def 
  self.biz_txn_acct_root.destroy if (self.biz_txn_acct_root && !self.biz_txn_acct_root.frozen?)
end

#initialize_biz_txn_account ⇒ Object



43
44
45
46
47
48
49
# File 'lib/erp_txns_and_accts/extensions/active_record/acts_as_biz_txn_account.rb', line 43

def 
  if self.new_record? and self.biz_txn_acct_root.nil?
    t = BizTxnAcctRoot.new
    self.biz_txn_acct_root = t
    t.biz_txn_acct = self
  end
end

#save_biz_txn_account ⇒ Object



51
52
53
# File 'lib/erp_txns_and_accts/extensions/active_record/acts_as_biz_txn_account.rb', line 51

def 
  self.biz_txn_acct_root.save
end