Fix CodeReuse/ActiveRecord violation

parent ce0afba8
......@@ -94,15 +94,13 @@ module Geo
private
# rubocop: disable CodeReuse/ActiveRecord
def all
if selective_sync?
LfsObject.joins(:projects).where(projects: { id: current_node.projects })
LfsObject.project_id_in(current_node.projects)
else
LfsObject.all
end
end
# rubocop: enable CodeReuse/ActiveRecord
def find_synced
if use_legacy_queries?
......
......@@ -12,6 +12,7 @@ module EE
after_destroy :log_geo_deleted_event
scope :geo_syncable, -> { with_files_stored_locally }
scope :project_id_in, ->(ids) { joins(:projects).merge(::Project.id_in(ids)) }
scope :with_files_stored_remotely, -> { where(file_store: LfsObjectUploader::Store::REMOTE) }
end
......
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