Class: Decidim::Meetings::ContentBlocks::HighlightedMeetingsCell

Inherits:
ContentBlocks::HighlightedElementsCell
  • Object
show all
Defined in:
app/cells/decidim/meetings/content_blocks/highlighted_meetings_cell.rb

Instance Method Summary collapse

Instance Method Details

#base_relationObject


7
8
9
10
11
12
13
14
15
# File 'app/cells/decidim/meetings/content_blocks/highlighted_meetings_cell.rb', line 7

def base_relation
  Decidim::Meetings::Meeting
    .except_withdrawn
    .published
    .not_hidden
    .upcoming
    .visible_for(current_user)
    .where(component: published_components)
end

#elementsObject


17
18
19
# File 'app/cells/decidim/meetings/content_blocks/highlighted_meetings_cell.rb', line 17

def elements
  @elements ||= base_relation.order(start_time: :asc).limit(limit)
end

#geolocation_enabled?Boolean

Returns:

  • (Boolean)

21
22
23
# File 'app/cells/decidim/meetings/content_blocks/highlighted_meetings_cell.rb', line 21

def geolocation_enabled?
  Decidim::Map.available?(:geocoding)
end