Skip to content

Commit

Permalink
account can acts as polymorphic model
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharipov Ruslan committed Oct 25, 2012
1 parent 01803e5 commit c9980a6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/plutus/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Account < ActiveRecord::Base
has_many :debit_amounts
has_many :credit_transactions, :through => :credit_amounts, :source => :transaction
has_many :debit_transactions, :through => :debit_amounts, :source => :transaction
belongs_to :accountable, :polymorphic => true

validates_presence_of :type, :name
validates_uniqueness_of :name
Expand Down

0 comments on commit c9980a6

Please sign in to comment.