Module: WhittakerTech::Aeon::Schedulable

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/whittaker_tech/aeon/schedulable.rb

Overview

DSL concern for host models that own a temporal allocation. Including this module and calling +schedule :name+ wires up associations and convenience verbs so the host never manipulates allocations directly.

Examples:

class Lesson < ApplicationRecord
  include WhittakerTech::Aeon::Schedulable
  schedule :time_slot
end

lesson.time_slot             # => active Allocation (valid_to IS NULL)
lesson.time_slot_occurrences # => Occurrence collection via :through
lesson.fork_future(pivot: 1.week.from_now, rrule: new_rule)
lesson.fork_all(rrule: new_rule)
lesson.override_occurrence(starts_at: t, canceled: true)
lesson.ensure_projected!(window: 30.days)