Merge branch '8784-dir-listings'
[arvados.git] / services / api / app / controllers / arvados / v1 / logs_controller.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 class Arvados::V1::LogsController < ApplicationController
6   # Overrides ApplicationController load_where_param
7   def load_where_param
8     super
9
10     # object_kind and column is now virtual,
11     # equivilent functionality is now provided by
12     # 'is_a', so fix up any old-style 'where' clauses.
13     if @where
14       @filters ||= []
15       if @where[:object_kind]
16         @filters << ['object_uuid', 'is_a', @where[:object_kind]]
17         @where.delete :object_kind
18       end
19     end
20   end
21
22   # Overrides ApplicationController load_filters_param
23   def load_filters_param
24     super
25
26     # object_kind and column is now virtual,
27     # equivilent functionality is now provided by
28     # 'is_a', so fix up any old-style 'filter' clauses.
29     @filters = @filters.map do |k|
30       if k[0] == 'object_kind' and k[1] == '='
31         ['object_uuid', 'is_a', k[2]]
32       else
33         k
34       end
35     end
36   end
37
38 end