Class: Decidim::FollowingCell

Inherits:
ViewModel
  • Object
show all
Includes:
CardHelper, CellsPaginateHelper
Defined in:
app/cells/decidim/following_cell.rb

Instance Method Summary collapse

Methods included from CardHelper

#card_for

Methods included from CellsPaginateHelper

#paginate, #per_page

Methods included from PaginateHelper

#decidim_paginate

Instance Method Details

#non_public_followings?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'app/cells/decidim/following_cell.rb', line 17

def non_public_followings?
  model.followings_blocked?
end

#public_followingsObject



13
14
15
# File 'app/cells/decidim/following_cell.rb', line 13

def public_followings
  @public_followings ||= Kaminari.paginate_array(model.public_users_followings).page(params[:page]).per(20)
end

#showObject



9
10
11
# File 'app/cells/decidim/following_cell.rb', line 9

def show
  render :show
end

#validation_messagesObject



21
22
23
24
25
26
# File 'app/cells/decidim/following_cell.rb', line 21

def validation_messages
  [].tap do |keys|
    keys << t("decidim.following.no_followings") if public_followings.blank?
    keys << t("decidim.following.non_public_followings") if non_public_followings?
  end
end