Class: Pageflow::Admin::UserAccountBadgeList

Inherits:
ViewComponent
  • Object
show all
Defined in:
app/views/components/pageflow/admin/user_account_badge_list.rb

Overview

Since:

  • 12.2

Instance Method Summary collapse

Instance Method Details

#build(user) ⇒ Object

Since:

  • 12.2



6
7
8
9
10
11
12
13
14
15
16
# File 'app/views/components/pageflow/admin/user_account_badge_list.rb', line 6

def build(user)
  ul class: 'badge_list' do
    user..each do |membership|
      if authorized?(:see_badge_belonging_to, membership.entity)
        build_badge(membership)
      end
    end

    build_admin_badge if user.admin?
  end
end