Project

General

Profile

Actions

Patch #31088

closed

Remove useless code in TimeEntryQuery#sql_for_activity_id_field

Added by Go MAEDA over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

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
Actions #1

Updated by Go MAEDA over 5 years ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch.

Actions

Also available in: Atom PDF