Class: Decidim::ProfileMemberOfCell

Inherits:
ViewModel
  • Object
show all
Defined in:
app/cells/decidim/profile_member_of_cell.rb

Instance Method Summary collapse

Instance Method Details

#membersObject



7
8
9
10
11
12
13
# File 'app/cells/decidim/profile_member_of_cell.rb', line 7

def members
  @members ||= Decidim::ParticipatorySpace::Member.where(user:)
                                                  .includes(:participatory_space)
                                                  .published
                                                  .select { |m| m.participatory_space.present? && m.participatory_space.published? }
                                                  .sort_by { |m| translated_attribute(m.participatory_space.title) }
end

#showObject



15
16
17
18
19
# File 'app/cells/decidim/profile_member_of_cell.rb', line 15

def show
  return unless members.any?

  render
end