app/controllers/homepage_controller.rb
def filter_unnecessary(search_params, numeric_fields)
    search_params.reject do |search_param|
      numeric_field = numeric_fields.find(search_param[:id])
      search_param.slice(:id, :value) == { id: numeric_field.id, value: (numeric_field.min..numeric_field.max) }
    end
  end
# Filter search params if their values equal min/max
Filter search params if their values equal min/max
Filter search params if their values equal min / max
def filter_unnecessary(search_params, numeric_fields)
    search_params.reject do |search_param|
      numeric_field = numeric_fields.find(search_param[:id])
      search_param.slice(:id, :value) == { id: numeric_field.id, value: (numeric_field.min..numeric_field.max) }
    end
  end
def filter_unnecessary ( search_params , numeric_fields ) search_params . reject do | search_param | numeric_field = numeric_fields . find ( search_param [ :id ] ) search_param . slice ( :id , :value ) == { id : numeric_field . id , value : ( numeric_field . min .. numeric_field . max ) } end end
Filter search params if their values equal min/max
Filter search params if their values equal min / max
search_params
numeric_fields