Skip to content

Instantly share code, notes, and snippets.

@mmaa
Created November 15, 2010 01:40
Show Gist options
  • Select an option

  • Save mmaa/676309 to your computer and use it in GitHub Desktop.

Select an option

Save mmaa/676309 to your computer and use it in GitHub Desktop.
envelope & internal_transactions
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