OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
remove ability to activate/deactivate using the update service
Ivan Kuchina71473cb6cb9
diff --git a/app/contracts/project_life_cycle_steps/update_contract.rb b/app/contracts/project_life_cycle_steps/update_contract.rbindex 83634dd420a..3e82db1a291 100644--- a/app/contracts/project_life_cycle_steps/update_contract.rb+++ b/app/contracts/project_life_cycle_steps/update_contract.rb@@ -34,7 +34,7 @@ module ProjectLifeCycleStepsdelegate :project, to: :model- def writable_attributes = %w[start_date finish_date active]+ def writable_attributes = %w[start_date finish_date]def validate_start_after_preceeding_phasesreturn unless model.active?diff --git a/spec/services/project_life_cycle_steps/update_service_spec.rb b/spec/services/project_life_cycle_steps/update_service_spec.rbindex 8e0a1496a3e..f3ad5c6a0da 100644--- a/spec/services/project_life_cycle_steps/update_service_spec.rb+++ b/spec/services/project_life_cycle_steps/update_service_spec.rb@@ -206,29 +206,5 @@ RSpec.describe ProjectLifeCycleSteps::UpdateService, type: :model doexpect(following).to have_attributes(start_date: date + 2, finish_date: date + 4201, duration: 3000)endend-- context "when activating" do- let(:phases) { [phase, following] }- let(:phase) { create(:project_phase, project:, date_range: date - 1..date + 1, active: false) }- let(:following) { create(:project_phase, project:, date_range: date + 6..date + 9, duration: 4) }-- it "reschedules starting with date after phase finish date" do- expect(service.call(active: true)).to be_success-- expect(following).to have_attributes(start_date: date + 2, finish_date: date + 7, duration: 4)- end- end-- context "when deactivating" do- let(:phases) { [phase, following] }- let(:phase) { create(:project_phase, project:, date_range: date - 1..date + 1, active: true) }- let(:following) { create(:project_phase, project:, date_range: date + 6..date + 9, duration: 4) }-- it "reschedules starting with phase start date" do- expect(service.call(active: false)).to be_success-- expect(following).to have_attributes(start_date: date - 1, finish_date: date + 2, duration: 4)- end- endendend