From a572554102f5023a9904a33d1b0968594b869875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=B1=E5=91=B1=E5=91=B1?= Date: Wed, 8 Nov 2023 10:59:30 +0800 Subject: [PATCH] rename --- app/models/issue.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index ce4154b6d..640d7300b 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -99,7 +99,7 @@ class Issue < ApplicationRecord scope :closed, ->{where(status_id: 5)} scope :opened, ->{where.not(status_id: 5)} after_create :incre_project_common, :incre_user_statistic, :incre_platform_statistic - after_save :change_versions_count, :send_update_message_to_notice_system, :associate_attachment_container, :fresh_root_issue_count + after_save :change_versions_count, :send_update_message_to_notice_system, :associate_attachment_container, :refresh_root_issue_count after_destroy :update_closed_issues_count_in_project!, :decre_project_common, :decre_user_statistic, :decre_platform_statistic def incre_project_common @@ -118,7 +118,7 @@ class Issue < ApplicationRecord CacheAsyncSetJob.perform_later('user_statistic_service', {issue_count: -1}, self.author_id) end - def fresh_root_issue_count + def refresh_root_issue_count return if root_id.nil? || root_id.zero? root_issue = Issue.find_by(id: root_id) root_count = Issue.where(root_id: root_id).count