Skip to content

Commit

Permalink
Appease rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn committed Dec 20, 2017
1 parent d64addc commit 9eef6be
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions core/lib/spree/core/search/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,16 @@ def add_eagerload_scopes(scope)
end

def add_search_scopes(base_scope)
@properties[:search].each do |name, scope_attribute|
scope_name = name.to_sym
if base_scope.respond_to?(:search_scopes) && base_scope.search_scopes.include?(scope_name.to_sym)
base_scope = base_scope.send(scope_name, *scope_attribute)
else
base_scope = base_scope.merge(Spree::Product.ransack({ scope_name => scope_attribute }).result)
if @properties[:search]
@properties[:search].each do |name, scope_attribute|
scope_name = name.to_sym
if base_scope.respond_to?(:search_scopes) && base_scope.search_scopes.include?(scope_name.to_sym)
base_scope = base_scope.send(scope_name, *scope_attribute)
else
base_scope = base_scope.merge(Spree::Product.ransack({ scope_name => scope_attribute }).result)
end
end
end if @properties[:search]
end
base_scope
end

Expand Down

0 comments on commit 9eef6be

Please sign in to comment.