Skip to content

Instantly share code, notes, and snippets.

@sprite2005
Created February 17, 2009 03:16
Show Gist options
  • Save sprite2005/65554 to your computer and use it in GitHub Desktop.
Save sprite2005/65554 to your computer and use it in GitHub Desktop.
class TransactionAccount < ActiveRecord::Base
composed_of :balance, :class_name => "Money", :mapping => [%w(cents account_balance_cents), %w(currency currency) ]
belongs_to :user
has_many sent_transactions, :class_name => "TransactionItem",
:foreign_key => "transaction_sender_account_id"
has_many received_transactions, :class_name => "TransactionItem",
:foreign_key => "transaction_receiver_account_id"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment