Class: Decidim::UserGroupPendingInvitationsListCell

Inherits:
ViewModel
  • Object
show all
Includes:
ApplicationHelper, CardHelper, CellsPaginateHelper
Defined in:
decidim-core/app/cells/decidim/user_group_pending_invitations_list_cell.rb

Overview

This cell is intended to be used on user profiles. Lists the invitations to user groups the given user has.

Instance Method Summary collapse

Methods included from CardHelper

#card_for

Instance Method Details

#invitationsObject


19
20
21
# File 'decidim-core/app/cells/decidim/user_group_pending_invitations_list_cell.rb', line 19

def invitations
  @invitations ||= Decidim::UserGroups::InvitedMemberships.for(model)
end

#own_profile?Boolean

Returns:

  • (Boolean)

23
24
25
# File 'decidim-core/app/cells/decidim/user_group_pending_invitations_list_cell.rb', line 23

def own_profile?
  current_user == model
end

#showObject


12
13
14
15
16
17
# File 'decidim-core/app/cells/decidim/user_group_pending_invitations_list_cell.rb', line 12

def show
  return if invitations.empty?
  return unless own_profile?

  render :show
end