Sha256: 2b918db1b293394fc6d92c33b9fb28e8bca71483b5936f0ab458124ad93a1974
Contents?: true
Size: 912 Bytes
Versions: 44
Compression:
Stored size: 912 Bytes
Contents
# frozen_string_literal: true module Decidim module Meetings module Calendar # This class handles how to convert a single meeting to the ICalendar # format. It caches its result until the meeting is updated again. # This class generates a ICalendar entry for an individual meeting. class MeetingCalendar < BaseCalendar # Renders the meeting in an ICalendar format. It caches the results in # Rails' cache. # # Returns a String. def events Rails.cache.fetch(cache_key) do MeetingToEvent.new(meeting).to_ical end end private alias meeting resource # Defines the cache key for the given component. # # Returns a String. def cache_key "meetings-calendar-meeting-#{meeting.id}-#{meeting.updated_at.to_i}" end end end end end
Version data entries
44 entries across 44 versions & 1 rubygems