Created
November 15, 2010 01:40
-
-
Save mmaa/676309 to your computer and use it in GitHub Desktop.
envelope & internal_transactions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Envelope < ActiveRecord::Base | |
| has_many :internal_transactions | |
| has_many :internal_transactions, :as => :source | |
| def transfers_in | |
| InternalTransaction.where(:envelope_id => self.id) | |
| end | |
| def transfers_out | |
| InternalTransaction.where(:source => self) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment