2018-11-02 15:43:07 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class MembersPreloader
|
|
|
|
attr_reader :members
|
|
|
|
|
|
|
|
def initialize(members)
|
|
|
|
@members = members
|
|
|
|
end
|
|
|
|
|
|
|
|
def preload_all
|
|
|
|
ActiveRecord::Associations::Preloader.new.preload(members, :user)
|
|
|
|
ActiveRecord::Associations::Preloader.new.preload(members, :source)
|
|
|
|
ActiveRecord::Associations::Preloader.new.preload(members.map(&:user), :status)
|
|
|
|
ActiveRecord::Associations::Preloader.new.preload(members.map(&:user), :u2f_registrations)
|
2020-09-07 08:08:27 -04:00
|
|
|
ActiveRecord::Associations::Preloader.new.preload(members.map(&:user), :webauthn_registrations)
|
2018-11-02 15:43:07 -04:00
|
|
|
end
|
|
|
|
end
|
2020-05-14 08:08:21 -04:00
|
|
|
|
|
|
|
MembersPreloader.prepend_if_ee('EE::MembersPreloader')
|