Patch #29710

Remove unused variable 'filter_options' from Query#add_filter

Added by Yuichi HARADA 15 days ago. Updated 14 days ago.

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


Category:Code cleanup/refactoring
Target version:4.0.0


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 || [''])}

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

Associated revisions

Revision 17560
Added by Go MAEDA 15 days ago

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

Patch by Yuichi HARADA.


#1 Updated by Go MAEDA 15 days ago

  • Target version set to 4.1.0

#2 Updated by Go MAEDA 15 days 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 14 days ago

  • Status changed from New to Closed

Also available in: Atom PDF