Actions
Patch #31088
closedRemove useless code in TimeEntryQuery#sql_for_activity_id_field
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
Updated by Go MAEDA over 5 years ago
- Status changed from New to Closed
- Assignee set to Go MAEDA
Committed the patch.
Actions