Generate schema and live_view scaffold for records

1. Records are not yet tied to artists
2. The generated edit route, along with related functionality, may be
   deleted as I don't think it's gonna be needed. Leaving it included in
   the commit for reference.
This commit is contained in:
Claudio Ortolina
2024-09-12 14:42:15 +01:00
parent 34111a44ba
commit e08fbe3740
12 changed files with 603 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
defmodule MusicLibrary.RecordsFixtures do
@moduledoc """
This module defines test helpers for creating
entities via the `MusicLibrary.Records` context.
"""
@doc """
Generate a record.
"""
def record_fixture(attrs \\ %{}) do
{:ok, record} =
attrs
|> Enum.into(%{
genres: ["option1", "option2"],
image: "some image",
musicbrainz_id: "7488a646-e31f-11e4-aace-600308960662",
title: "some title",
type: :album,
year: 42
})
|> MusicLibrary.Records.create_record()
record
end
end