Merge branch '3235-top-nav-site-search' refs #3235
[arvados.git] / apps / workbench / app / controllers / search_controller.rb
1 class SearchController < ApplicationController
2   def find_objects_for_index
3     search_what = Group
4     if params[:project_uuid]
5       # Special case for "search all things in project":
6       @filters = @filters.select do |attr, operator, operand|
7         not (attr == 'owner_uuid' and operator == '=')
8       end
9       search_what = Group.find(params[:project_uuid])
10     end
11     @objects = search_what.contents(limit: @limit,
12                                     offset: @offset,
13                                     filters: @filters,
14                                     include_linked: true)
15     super
16   end
17
18   def next_page_href with_params={}
19     super with_params.merge(last_object_class: @objects.last.class.to_s)
20   end
21 end