Sha256: 41919dddb078a86b499774c25ac85a4475d04ca564055e81b9ec352f19b25d58

Contents?: true

Size: 823 Bytes

Versions: 9

Compression:

Stored size: 823 Bytes

Contents

Party.class_eval do

  has_many :biz_txn_acct_party_roles
	has_many :biz_txn_acct_roots, :through => :biz_txn_acct_party_roles, :dependent => :destroy
	# has_many :entity_content_assignments, :as => :da_assignment
	# has_many :credit_cards, :class_name => "CreditCard", :foreign_key => "cardholder_id"


  # Wrapper to get all party accounts
  def accounts
    biz_txn_acct_roots
  end

  # Adds a business account (BizTxnAcctPartyRole)
	def add_business_account( acct_root, biz_txn_acct_pty_rtype )
		biz_txn_acct_pty_rtype = BizTxnAcctPtyRtype.iid(biz_txn_acct_pty_rtype) if biz_txn_acct_pty_rtype.is_a? String
    raise "BizTxnAcctPtyRtype does not exist" if biz_txn_acct_pty_rtype.nil?

    apr = BizTxnAcctPartyRole.new
		apr.biz_txn_acct_pty_rtype = biz_txn_acct_pty_rtype
    biz_txn_acct_roots << acct_root
	end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
erp_txns_and_accts-4.0.0 app/models/extensions/party.rb
erp_txns_and_accts-3.1.1 app/models/extensions/party.rb
erp_txns_and_accts-3.0.6 app/models/extensions/party.rb
erp_txns_and_accts-3.1.0 app/models/extensions/party.rb
erp_txns_and_accts-3.0.5 app/models/extensions/party.rb
erp_txns_and_accts-3.0.4 app/models/extensions/party.rb
erp_txns_and_accts-3.0.3 app/models/extensions/party.rb
erp_txns_and_accts-3.0.2 app/models/extensions/party.rb
erp_txns_and_accts-3.0.1 app/models/extensions/party.rb