Commit 1a6e1174 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre Committed by Mike Kozono

Remove Geo::Fdw::GeoNode#lfs_object_registries method

parent c3e0176f
......@@ -64,13 +64,6 @@ module Geo
.joins(inner_join_restricted_lfs_objects)
end
def lfs_object_registries
return Geo::LfsObjectRegistry.all unless selective_sync?
Gitlab::Geo::Fdw::LfsObjectRegistryQueryBuilder.new
.for_lfs_objects(lfs_objects)
end
def projects
return Geo::Fdw::Project.all unless selective_sync?
......
# frozen_string_literal: true
# Builder class to create composable queries using FDW to
# retrieve file registries for LFS objects.
#
# Basic usage:
#
# Gitlab::Geo::Fdw::LfsObjectRegistryQueryBuilder
# .new
# .inner_join_lfs_objects
#
module Gitlab
module Geo
class Fdw
class LfsObjectRegistryQueryBuilder < BaseQueryBuilder
# rubocop:disable CodeReuse/ActiveRecord
def for_lfs_objects(ids)
query
.joins(fdw_inner_join_lfs_objects)
.model_id_in(ids)
end
# rubocop:enable CodeReuse/ActiveRecord
private
def base
::Geo::LfsObjectRegistry
.select(registry_table[Arel.star])
end
def registry_table
::Geo::LfsObjectRegistry.arel_table
end
def fdw_table
::Geo::Fdw::LfsObject.arel_table
end
def fdw_inner_join_lfs_objects
registry_table
.join(fdw_table, Arel::Nodes::InnerJoin)
.on(registry_table[:lfs_object_id].eq(fdw_table[:id]))
.join_sources
end
end
end
end
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