Does not use magic finders since they are deprecated in AR 5

parent d77aaa35
......@@ -13,7 +13,7 @@ module Gitlab
# Subclasses should return the number of bytes downloaded,
# or nil or -1 if a failure occurred.
def execute
upload = Upload.find_by_id(object_db_id)
upload = Upload.find_by(id: object_db_id)
return unless upload.present?
transfer = ::Gitlab::Geo::FileTransfer.new(object_type.to_sym, upload)
......
......@@ -9,7 +9,7 @@ module Gitlab
end
def execute
recorded_file = Upload.find_by_id(object_db_id)
recorded_file = Upload.find_by(id: object_db_id)
return error unless recorded_file&.exist?
return error unless valid?(recorded_file)
......
......@@ -2,7 +2,7 @@ module Gitlab
module Geo
class LfsDownloader < FileDownloader
def execute
lfs_object = LfsObject.find_by_id(object_db_id)
lfs_object = LfsObject.find_by(id: object_db_id)
return unless lfs_object.present?
transfer = ::Gitlab::Geo::LfsTransfer.new(lfs_object)
......
......@@ -2,7 +2,7 @@ module Gitlab
module Geo
class LfsUploader < FileUploader
def execute
lfs_object = LfsObject.find(object_db_id)
lfs_object = LfsObject.find_by(id: object_db_id)
return error unless lfs_object.present?
return error if message[:sha256] != lfs_object.oid
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment