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
Rename WorkPackage#life_cycle_step to #project_life_cycle_step
Dombi Attila1a9d77e4a6ad
diff --git a/app/models/project/life_cycle_step.rb b/app/models/project/life_cycle_step.rbindex 97f23f9339c..90d4e74faff 100644--- a/app/models/project/life_cycle_step.rb+++ b/app/models/project/life_cycle_step.rb@@ -31,7 +31,7 @@ class Project::LifeCycleStep < ApplicationRecordbelongs_to :definition,optional: false,class_name: "Project::LifeCycleStepDefinition"- has_many :work_packages, inverse_of: :life_cycle_step, dependent: :nullify+ has_many :work_packages, inverse_of: :project_life_cycle_step, dependent: :nullifyattr_readonly :definition_iddiff --git a/app/models/work_package.rb b/app/models/work_package.rbindex 560f7604448..a1ec0389266 100644--- a/app/models/work_package.rb+++ b/app/models/work_package.rb@@ -54,7 +54,7 @@ class WorkPackage < ApplicationRecordbelongs_to :assigned_to, class_name: "Principal", optional: truebelongs_to :responsible, class_name: "Principal", optional: truebelongs_to :version, optional: true- belongs_to :life_cycle_step, class_name: "Project::LifeCycleStep", optional: true+ belongs_to :project_life_cycle_step, class_name: "Project::LifeCycleStep", optional: truebelongs_to :priority, class_name: "IssuePriority"belongs_to :category, class_name: "Category", optional: truediff --git a/db/migrate/20241105175000_add_life_cycle_to_work_packages.rb b/db/migrate/20241105175000_add_life_cycle_to_work_packages.rbindex eb8081aed5f..423eb83cac7 100644--- a/db/migrate/20241105175000_add_life_cycle_to_work_packages.rb+++ b/db/migrate/20241105175000_add_life_cycle_to_work_packages.rb@@ -1,8 +1,5 @@class AddLifeCycleToWorkPackages < ActiveRecord::Migration[7.1]def change- add_reference :work_packages,- :life_cycle_step,- foreign_key: { to_table: :project_life_cycle_steps },- null: true+ add_reference :work_packages, :project_life_cycle_step, null: trueendenddiff --git a/spec/models/work_package_spec.rb b/spec/models/work_package_spec.rbindex cabd9fc3808..bda8a4caefe 100644--- a/spec/models/work_package_spec.rb+++ b/spec/models/work_package_spec.rb@@ -70,7 +70,7 @@ RSpec.describe WorkPackage doit { is_expected.to belong_to(:assigned_to).class_name("Principal").optional }it { is_expected.to belong_to(:responsible).class_name("Principal").optional }it { is_expected.to belong_to(:version).optional }- it { is_expected.to belong_to(:life_cycle_step).class_name("Project::LifeCycleStep").optional }+ it { is_expected.to belong_to(:project_life_cycle_step).class_name("Project::LifeCycleStep").optional }it { is_expected.to belong_to(:priority).class_name("IssuePriority") }it { is_expected.to belong_to(:category).optional }it { is_expected.to have_many(:time_entries).dependent(:delete_all) }