From 1138616e7717ab59cb2119fc890dd311e686bbeb Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Thu, 17 Jun 2010 12:13:14 -0700 Subject: [PATCH] [#4177] Added Contract associations. --- app/models/contract.rb | 5 +++++ test/unit/contract_test.rb | 2 ++ 2 files changed, 7 insertions(+) diff --git a/app/models/contract.rb b/app/models/contract.rb index 3c3f440..958bf07 100644 --- a/app/models/contract.rb +++ b/app/models/contract.rb @@ -1,3 +1,8 @@ class Contract < ActiveRecord::Base unloadable + + # Associations + belongs_to :project + belongs_to :account_executive, :class_name => 'User', :foreign_key => 'account_executive_id' + end diff --git a/test/unit/contract_test.rb b/test/unit/contract_test.rb index 9095528..c128b6e 100644 --- a/test/unit/contract_test.rb +++ b/test/unit/contract_test.rb @@ -1,4 +1,6 @@ require File.dirname(__FILE__) + '/../test_helper' class ContractTest < ActiveSupport::TestCase + should_belong_to :account_executive + should_belong_to :project end