Added extension and screen relation associations

Necessary, now that a screen has a `extension_id` foreign ID, to allow a screen to belong to an extension while an extension can have many screens.

Issue: 360
Milestone: minor
This commit is contained in:
Brooke Kuhlmann
2026-08-10 10:36:44 -06:00
parent 3603e65961
commit be1f9c19f8
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -11,6 +11,7 @@ module Terminus
has_many :extension_models, relation: :extension_model
has_many :models, through: :extension_model, relation: :model, as: :models
has_many :extension_exchanges, relation: :extension_exchange
has_many :screens, relation: :screen
end
end
end
+1
View File
@@ -7,6 +7,7 @@ module Terminus
schema :screen, infer: true do
associations do
belongs_to :model, relation: :model
belongs_to :extension, relation: :extension
belongs_to :template, relation: :screen_template
has_many :playlist_items, relation: :playlist_item, as: :playlist_items, view: :ordered
has_many :playlists, through: :playlist_item, relation: :playlist, as: :playlists