mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Better use merge! instead of q = q.merge
This commit is contained in:
@@ -106,13 +106,13 @@ class ProductsReflex < ApplicationReflex
|
||||
|
||||
def ransack_query
|
||||
query = { s: "name desc" }
|
||||
query = query.merge({ supplier_id_in: @producer_id }) if @producer_id.present?
|
||||
query.merge!(supplier_id_in: @producer_id) if @producer_id.present?
|
||||
if @search_term.present?
|
||||
# rubocop:disable Layout/LineLength
|
||||
query = query.merge({ name_or_meta_keywords_or_variants_display_as_or_variants_display_name_or_supplier_name_cont: @search_term })
|
||||
query.merge!(name_or_meta_keywords_or_variants_display_as_or_variants_display_name_or_supplier_name_cont: @search_term)
|
||||
# rubocop:enable Layout/LineLength
|
||||
end
|
||||
query = query.merge({ primary_taxon_id_in: @category_id }) if @category_id.present?
|
||||
query.merge!(primary_taxon_id_in: @category_id) if @category_id.present?
|
||||
query
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user