2018-07-17 12:50:37 -04:00
|
|
|
# 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
|
|
|
|
|
2018-08-27 11:31:01 -04:00
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2018-02-07 08:00:53 -05:00
|
|
|
def find_locks
|
|
|
|
options = params.slice(:id, :path).compact.symbolize_keys
|
|
|
|
|
|
|
|
project.lfs_file_locks.where(options)
|
|
|
|
end
|
2018-08-27 11:31:01 -04:00
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2018-02-07 08:00:53 -05:00
|
|
|
end
|
|
|
|
end
|