Files
Brooke Kuhlmann 89373e5bfc Added model palette relation
Necessary to provide low level database access. This includes adding associations to the existing model and palette relations.

Issue: 303
Milestone: minor
2026-04-21 10:50:05 -06:00

21 lines
655 B
Ruby

# frozen_string_literal: true
module Terminus
module Relations
# The model relation.
class Model < DB::Relation
schema :model, infer: true do
associations do
belongs_to :default_palette, relation: :palette
has_many :devices, relation: :device
has_many :screens, relation: :screen
has_many :extension_models, relation: :extension_model
has_many :extensions, through: :extension_model, relation: :extension
has_many :model_palettes, relation: :model_palette
has_many :palettes, through: :model_palette, relation: :palette
end
end
end
end
end