Patch #31088
Remove useless code in TimeEntryQuery#sql_for_activity_id_field
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | Code cleanup/refactoring | |||
Target version: | 4.1.0 |
Description
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
Associated revisions
Remove useless code in TimeEntryQuery#sql_for_activity_id_field (#31088).
Patch by Go MAEDA.