From 4d5f395fdf433b8739fbed58de22ef117346738c Mon Sep 17 00:00:00 2001 From: Hagen Schink Date: Tue, 3 Sep 2013 13:42:05 +0200 Subject: [PATCH] Allows inter-project work package hierarchies [skip ci] --- app/models/work_package/validations.rb | 1 - spec/models/planning_element_spec.rb | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/app/models/work_package/validations.rb b/app/models/work_package/validations.rb index 6be88ffdac..e1d86c2693 100644 --- a/app/models/work_package/validations.rb +++ b/app/models/work_package/validations.rb @@ -65,7 +65,6 @@ module WorkPackage::Validations def validate_parent_constraint if self.parent errors.add :parent, :cannot_be_milestone if parent.is_milestone? - errors.add :parent, :cannot_be_in_another_project if parent.project != project errors.add :parent, :cannot_be_in_recycle_bin if parent.deleted? end end diff --git a/spec/models/planning_element_spec.rb b/spec/models/planning_element_spec.rb index ba96448cab..10a5e014e7 100644 --- a/spec/models/planning_element_spec.rb +++ b/spec/models/planning_element_spec.rb @@ -171,20 +171,6 @@ describe PlanningElement do planning_element.errors[:parent].should be_present planning_element.errors[:parent].should == ["cannot be a milestone"] end - - it 'is invalid if parent is in another project' do - parent = PlanningElement.new.tap do |pe| - pe.send(:assign_attributes, attributes.merge(:project_id => FactoryGirl.build(:project)), :without_protection => true) - end - - attributes[:parent] = parent - planning_element = PlanningElement.new.tap { |pe| pe.send(:assign_attributes, attributes, :without_protection => true) } - - planning_element.should_not be_valid - - planning_element.errors[:parent].should be_present - planning_element.errors[:parent].should == ["cannot be in another project"] - end end end