gitlab-org--gitlab-foss/app/services/lfs/locks_finder_service.rb

22 lines
442 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2018-02-07 08:00:53 -05:00
module Lfs
class LocksFinderService < BaseService
def execute
success(locks: find_locks)
rescue => ex
error(ex.message, 500)
end
private
# rubocop: disable CodeReuse/ActiveRecord
2018-02-07 08:00:53 -05:00
def find_locks
options = params.slice(:id, :path).to_h.compact.symbolize_keys
2018-02-07 08:00:53 -05:00
project.lfs_file_locks.where(options)
end
# rubocop: enable CodeReuse/ActiveRecord
2018-02-07 08:00:53 -05:00
end
end