defmodule McFun.Games.Playlist do
use Ash.Resource,
data_layer: AshPostgres.DataLayer,
extensions: [
AshGraphql.Resource
]
alias McFun.Games.PlaylistEntry
alias McFun.Games.Game
postgres do
schema("games")
repo(McCore.Repo)
table("playlists")
end
relationships do
many_to_many :games, Game do
through(PlaylistEntry)
source_attribute_on_join_resource(:playlist_id)
destination_attribute_on_join_resource(:asset_id)
end
end
end
defmodule McFun.Games.Playlist do
use Ash.Resource,
data_layer: AshPostgres.DataLayer,
extensions: [
AshGraphql.Resource
]
alias McFun.Games.PlaylistEntry
alias McFun.Games.Game
postgres do
schema("games")
repo(McCore.Repo)
table("playlists")
end
relationships do
many_to_many :games, Game do
through(PlaylistEntry)
source_attribute_on_join_resource(:playlist_id)
destination_attribute_on_join_resource(:asset_id)
end
end
end