Class: Decidim::Votings::ContentBlocks::HighlightedVotingsCell

Inherits:
Decidim::ViewModel
  • Object
show all
Defined in:
app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb

Instance Method Summary collapse

Instance Method Details

#decidim_votingsObject



27
28
29
# File 'app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb', line 27

def decidim_votings
  Decidim::Votings::Engine.routes.url_helpers
end

#highlighted_votingsObject



17
18
19
20
21
# File 'app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb', line 17

def highlighted_votings
  OrganizationPrioritizedVotings.new(current_organization, current_user)
                                .query
                                .limit(max_results)
end

#i18n_scopeObject



23
24
25
# File 'app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb', line 23

def i18n_scope
  "decidim.votings.pages.home.highlighted_votings"
end

#max_resultsObject



13
14
15
# File 'app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb', line 13

def max_results
  model.settings.max_results
end

#showObject



9
10
11
# File 'app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb', line 9

def show
  render if highlighted_votings.any?
end