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

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

module Lfs
  class LocksFinderService < BaseService
    def execute
      success(locks: find_locks)
    rescue => ex
      error(ex.message, 500)
    end

    private

    # rubocop: disable CodeReuse/ActiveRecord
    def find_locks
      options = params.slice(:id, :path).to_h.compact.symbolize_keys

      project.lfs_file_locks.where(options)
    end
    # rubocop: enable CodeReuse/ActiveRecord
  end
end