Welcome to mirror list, hosted at ThFree Co, Russian Federation.

settings_finder.rb « settings « vs_code « finders « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 459ccdbe566f26c16b08d32aa22324155d232c2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

module VsCode
  module Settings
    class SettingsFinder
      def initialize(current_user, setting_types)
        @current_user = current_user
        @setting_types = setting_types
      end

      def execute
        relation = User.find(current_user.id).vscode_settings
        return relation unless setting_types.present?

        relation.by_setting_type(setting_types)
      end

      private

      attr_accessor :current_user, :setting_types
    end
  end
end