Skip to content

Commit b8edded

Browse files
committed
Fix general search bar not restricting to current space
1 parent 83bb4d4 commit b8edded

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

app/controllers/search_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ def index
1313
search_models.each do |model_name|
1414
model = model_name.constantize
1515
@results[model_name.underscore.pluralize.to_sym] = Sunspot.search(model) do
16+
if Facets.applicable?(:across_all_spaces, model)
17+
Facets.across_all_spaces(self, false, current_user)
18+
end
19+
1620
fulltext search_params
1721

1822
with('end').greater_than(Time.zone.now) if model_name == 'Event'

0 commit comments

Comments
 (0)