プロジェクト

全般

プロフィール

Vote #79936

完了

Remove useless code in TimeEntryQuery#sql_for_activity_id_field

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Code cleanup/refactoring_30
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
30
version_id:
127
issue_org_id:
31088
author_id:
332
assigned_to_id:
332
comments:
1
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

I think we can safely remove the following two lines of code in TimeEntryQuery#sql_for_activity_id_field because the variable condition_on_id and condition_on_parent_id are never been used.


diff --git a/app/models/time_entry_query.rb b/app/models/time_entry_query.rb
index f974ab6d9..e1cb753ad 100644
--- a/app/models/time_entry_query.rb
+++ b/app/models/time_entry_query.rb
@@ -190,18 +190,16 @@ class TimeEntryQuery < Query
         "#{TimeEntry.table_name}.issue_id NOT IN (#{issue_ids.join(',')})"
       else
         "1=1"
       end
     end
   end
 
   def sql_for_activity_id_field(field, operator, value)
-    condition_on_id = sql_for_field(field, operator, value, Enumeration.table_name, 'id')
-    condition_on_parent_id = sql_for_field(field, operator, value, Enumeration.table_name, 'parent_id')
     ids = value.map(&:to_i).join(',')
     table_name = Enumeration.table_name
     if operator == '='
       "(#{table_name}.id IN (#{ids}) OR #{table_name}.parent_id IN (#{ids}))"
     else
       "(#{table_name}.id NOT IN (#{ids}) AND (#{table_name}.parent_id IS NULL OR #{table_name}.parent_id NOT IN (#{ids})))"
     end
   end

journals

Committed the patch.
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリCode cleanup/refactoring_30 にセット
  • 対象バージョン4.1.0_127 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0