Class: Decidim::FollowingCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::FollowingCell
- Includes:
- CardHelper, CellsPaginateHelper
- Defined in:
- app/cells/decidim/following_cell.rb
Instance Method Summary collapse
- #non_public_followings? ⇒ Boolean
- #public_followings ⇒ Object
- #show ⇒ Object
- #validation_messages ⇒ Object
Methods included from CardHelper
Methods included from CellsPaginateHelper
Methods included from PaginateHelper
Instance Method Details
#non_public_followings? ⇒ Boolean
17 18 19 |
# File 'app/cells/decidim/following_cell.rb', line 17 def non_public_followings? model.followings_blocked? end |
#public_followings ⇒ Object
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 |
#show ⇒ Object
9 10 11 |
# File 'app/cells/decidim/following_cell.rb', line 9 def show render :show end |
#validation_messages ⇒ Object
21 22 23 24 25 26 |
# File 'app/cells/decidim/following_cell.rb', line 21 def [].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 |