From be1f9c19f8e6658fb6332be195cd3e8d8d76fe06 Mon Sep 17 00:00:00 2001 From: Brooke Kuhlmann Date: Mon, 10 Aug 2026 10:13:12 -0600 Subject: [PATCH] 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 --- app/relations/extension.rb | 1 + app/relations/screen.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/relations/extension.rb b/app/relations/extension.rb index 9e03151b..29cbea30 100644 --- a/app/relations/extension.rb +++ b/app/relations/extension.rb @@ -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 diff --git a/app/relations/screen.rb b/app/relations/screen.rb index acf576fb..c6bafa83 100644 --- a/app/relations/screen.rb +++ b/app/relations/screen.rb @@ -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