mirror of
https://github.com/usetrmnl/terminus.git
synced 2026-08-13 14:29:27 -07:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user