Patch #29710

Remove unused variable 'filter_options' from Query#add_filter

Added by Yuichi HARADA 2 months ago. Updated 2 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Code cleanup/refactoring
Target version:4.0.0

Description

The variable was changed in r86 along with the instance method Query#add_filter.
However, filter_options is unused.
(In r86, most of the filter_options's processing was comment out.)

I would like to change it as follows.

diff --git a/app/models/query.rb b/app/models/query.rb
index fa5c926ba..2c0f90161 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -613,7 +613,6 @@ class Query < ActiveRecord::Base
     return unless values.nil? || values.is_a?(Array)
     # check if field is defined as an available filter
     if available_filters.has_key? field
-      filter_options = available_filters[field]
       filters[field] = {:operator => operator, :values => (values || [''])}
     end
   end

unused-variable-filter_options.patch Magnifier (487 Bytes) Yuichi HARADA, 2018-10-02 02:28

Associated revisions

Revision 17560
Added by Go MAEDA 2 months ago

Remove unused variable 'filter_options' from Query#add_filter (#29710).

Patch by Yuichi HARADA.

History

#1 Updated by Go MAEDA 2 months ago

  • Target version set to 4.1.0

#2 Updated by Go MAEDA 2 months ago

  • Subject changed from Remove unused variable 'filter_options'(Query#add_filter) to Remove unused variable 'filter_options' from Query#add_filter
  • Assignee set to Go MAEDA
  • Target version changed from 4.1.0 to 4.0.0

Committed. Thank you for detecting and reporting it.

#3 Updated by Go MAEDA 2 months ago

  • Status changed from New to Closed

Also available in: Atom PDF