Commit 60f4a943 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'ce-jej/group-saml-sso-badges' into 'master'

CE MR for Group SAML SSO badges

See merge request gitlab-org/gitlab-ce!22587
parents 992cff9c d76fdfcf
...@@ -12,12 +12,7 @@ module MembersPresentation ...@@ -12,12 +12,7 @@ module MembersPresentation
).fabricate! ).fabricate!
end end
# rubocop: disable CodeReuse/ActiveRecord
def preload_associations(members) def preload_associations(members)
ActiveRecord::Associations::Preloader.new.preload(members, :user) MembersPreloader.new(members).preload_all
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)
end end
# rubocop: enable CodeReuse/ActiveRecord
end end
# 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)
end
end
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
= user_status(user) = user_status(user)
%span.cgray= user.to_reference %span.cgray= user.to_reference
= render_if_exists 'shared/members/ee/sso_badge', member: member
- if user == current_user - if user == current_user
%span.badge.badge-success.prepend-left-5 It's you %span.badge.badge-success.prepend-left-5 It's you
......
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