Installation¶
Requirements¶
- Ruby >= 3.1
- Rails ~> 7.1
- PostgreSQL 16+
- UUID primary keys on host models that include
Schedulable
Setup¶
Add the gem to your Gemfile:
gem 'whittaker_tech-aeon'
Install the bundle:
bundle install
Run the install generator (copies the initializer and migrations into your app):
rails generate whittaker_tech:aeon:install
Optionally edit the generated initializer at config/initializers/aeon.rb to customize settings.
Run the copied migrations to create the wt_aeon schema and tables:
rails db:migrate
What the Generator Creates¶
The install generator copies:
- Initializer (
config/initializers/aeon.rb) — aWhittakerTech::Aeon.configureblock with sensible defaults - Migrations — creates the
wt_aeonPostgreSQL schema with three tables:wt_aeon.allocations— immutable temporal lawswt_aeon.occurrences— materialized predictions with GiST-indexedtstzrangewt_aeon.overrides— surgical single-instance deviations
Host Model Requirements¶
Any model that includes WhittakerTech::Aeon::Schedulable must use UUID primary keys:
class CreateLessons < ActiveRecord::Migration[7.1]
def change
create_table :lessons, id: :uuid do |t|
t.string :title, null: false
t.timestamps
end
end
end
This is required because all Aeon foreign keys and polymorphic IDs are UUIDs.