summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-09-22 07:50:46 +0000
committerGo MAEDA <maeda@farend.jp>2020-09-22 07:50:46 +0000
commit75b3e88cee997a3e24c406553b87eb43c82efe97 (patch)
tree34d93d2d52cd8d25548640d2d6f920779b403575 /app
parent4fdac0655ab808955abdbf69ae31ed337f8c7738 (diff)
downloadredmine-75b3e88cee997a3e24c406553b87eb43c82efe97.tar.gz
redmine-75b3e88cee997a3e24c406553b87eb43c82efe97.zip
Fix that updating time tracking activities in a project may take a long time (#33289).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@20066 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/enumeration.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb
index 4710fde81..dfa6ba49f 100644
--- a/app/models/enumeration.rb
+++ b/app/models/enumeration.rb
@@ -24,7 +24,7 @@ class Enumeration < ActiveRecord::Base
belongs_to :project
- acts_as_positioned :scope => :parent_id
+ acts_as_positioned :scope => %i[project_id parent_id]
acts_as_customizable
acts_as_tree
@@ -149,7 +149,7 @@ class Enumeration < ActiveRecord::Base
# position as the overridden enumeration
def update_position
super
- if saved_change_to_position?
+ if saved_change_to_position? && self.parent_id.nil?
self.class.where.not(:parent_id => nil).update_all(
"position = coalesce((
select position