Sha256: a173b58446d926a81879cbdb5b373812bfe75f4dcd9cac1cc5ac2f4f6794adbb
Contents?: true
Size: 1.07 KB
Versions: 8
Compression:
Stored size: 1.07 KB
Contents
# frozen_string_literal: true module Decidim module Meetings module Calendar # This class handles how to convert a component meetings to the ICalendar # format. It caches its result until the component is updated again. class ComponentCalendar < BaseCalendar # Renders the meetings in an ICalendar format. It caches the results in # Rails' cache. # # Returns a String. def events filtered_meetings.map do |meeting| MeetingCalendar.new(meeting).events end.compact.join end private alias component resource # Finds the component meetings. # # Returns a collection of Meetings. def meetings Decidim::Meetings::Meeting.where(component:) end # Finds the component meetings. # # Returns a collection of Meetings filtered based on provided params. def filtered_meetings meetings.not_hidden.published.except_withdrawn.ransack(@filters).result end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems