diff options
author | Go MAEDA <maeda@farend.jp> | 2023-03-25 05:09:56 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2023-03-25 05:09:56 +0000 |
commit | 53f2aca3ef4976a48392367e5892caf71ac28046 (patch) | |
tree | f84eae3c5f1d11eb49aeff7b0e33cc92fd3a98c9 /app | |
parent | 817d8100c1aecc28f5327f0c9b0e7f9fd54d04c8 (diff) | |
download | redmine-53f2aca3ef4976a48392367e5892caf71ac28046.tar.gz redmine-53f2aca3ef4976a48392367e5892caf71ac28046.zip |
"Cannot delete enumeration" error may occur when attempting to delete a project with time entries (#38286).
Patch by Holger Just and Mizuki ISHIKAWA.
git-svn-id: https://svn.redmine.org/redmine/trunk@22155 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 43a55428e..a50fa8807 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -30,8 +30,6 @@ class Project < ActiveRecord::Base # Maximum length for project identifiers IDENTIFIER_MAX_LENGTH = 100 - # Specific overridden Activities - has_many :time_entry_activities, :dependent => :destroy has_many :memberships, :class_name => 'Member', :inverse_of => :project # Memberships of active users only has_many :members, @@ -44,6 +42,8 @@ class Project < ActiveRecord::Base belongs_to :default_version, :class_name => 'Version' belongs_to :default_assigned_to, :class_name => 'Principal' has_many :time_entries, :dependent => :destroy + # Specific overridden Activities + has_many :time_entry_activities, :dependent => :destroy has_many :queries, :dependent => :destroy has_many :documents, :dependent => :destroy has_many :news, lambda {includes(:author)}, :dependent => :destroy |