debian-mirror-gitlab/app/models/members_preloader.rb
2023-06-20 00:43:36 +05:30

22 lines
420 B
Ruby

# frozen_string_literal: true
class MembersPreloader
attr_reader :members
def initialize(members)
@members = members
end
def preload_all
ActiveRecord::Associations::Preloader.new(
records: members,
associations: [
:source,
:created_by,
{ user: [:status, :webauthn_registrations] }
]
).call
end
end
MembersPreloader.prepend_mod_with('MembersPreloader')