Vote #79936
完了Remove useless code in TimeEntryQuery#sql_for_activity_id_field
開始日:
2022/05/09
期日:
進捗率:
0%
予定工数:
Redmineorg_URL:
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:
説明
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 にセット
いいね!0