summaryrefslogtreecommitdiff
path: root/lib/gitlab/usage/metrics/names_suggestions/relation_parsers/having_constraints.rb
blob: 8dd3b1ff5c671086d3dd807116da9cab6d346174 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen_string_literal: true

module Gitlab
  module Usage
    module Metrics
      module NamesSuggestions
        module RelationParsers
          class HavingConstraints < ::Arel::Visitors::PostgreSQL
            # rubocop:disable Naming/MethodName
            def visit_Arel_Nodes_SelectCore(object, collector)
              collect_nodes_for(object.havings, collector, "") || collector
            end
            # rubocop:enable Naming/MethodName

            def quote(value)
              value.to_s
            end

            def quote_table_name(name)
              name.to_s
            end

            def quote_column_name(name)
              name.to_s
            end
          end
        end
      end
    end
  end
end