Added issues relationship to deliverables. #1135

This commit is contained in:
Eric Davis
2008-05-21 10:22:13 -07:00
parent a9c8897ed4
commit 697b966dd7
3 changed files with 14 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ class Deliverable < ActiveRecord::Base
validates_presence_of :subject
belongs_to :project
has_many :issues
# TODO: mocked
def score

View File

@@ -0,0 +1,9 @@
class AddDeliverableIdToIssues < ActiveRecord::Migration
def self.up
add_column :issues, :deliverable_id, :integer
end
def self.down
remove_column :issues, :deliverable_id
end
end

View File

@@ -14,6 +14,10 @@ describe Deliverable, 'associations' do
it "should have a project association" do
Deliverable.reflect_on_association(:project).should_not be( nil )
end
it "should have an issues association" do
Deliverable.reflect_on_association(:issues).should_not be( nil )
end
end
describe Deliverable, '.overhead' do