Order cycle can have the same enterprise participating as supplier, coordinator and distributor

This commit is contained in:
Rohan Mitchell
2014-04-02 11:54:28 +11:00
parent 98d599e5f7
commit 32ffd05ba0
2 changed files with 7 additions and 3 deletions

View File

@@ -11,7 +11,7 @@ class Exchange < ActiveRecord::Base
has_many :enterprise_fees, :through => :exchange_fees
validates_presence_of :order_cycle, :sender, :receiver
validates_uniqueness_of :sender_id, :scope => [:order_cycle_id, :receiver_id]
validates_uniqueness_of :sender_id, :scope => [:order_cycle_id, :receiver_id, :incoming]
accepts_nested_attributes_for :variants