mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 03:32:06 +00:00
Rename Tag to Theme across code and schema
Rename the endgame-label concept from Tag to Theme to match the glossary: the context becomes Chesstrainer.Themes, the schema Chesstrainer.Themes.Theme, and the Endgame association is :themes. The category enum (endgame/opening/tactic) is preserved. Rewrite the original migrations in place so themes / endgames_themes (with theme_id) are created directly, instead of adding a transition migration. Closes #12
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
defmodule Chesstrainer.TagsFixtures do
|
||||
@moduledoc """
|
||||
This module defines test helpers for creating
|
||||
entities via the `Chesstrainer.Tags` context.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Generate a unique tag name.
|
||||
"""
|
||||
def unique_tag_name, do: "some name#{System.unique_integer([:positive])}"
|
||||
|
||||
@doc """
|
||||
Generate a tag.
|
||||
"""
|
||||
def tag_fixture(attrs \\ %{}) do
|
||||
{:ok, tag} =
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
category: :endgame,
|
||||
name: unique_tag_name()
|
||||
})
|
||||
|> Chesstrainer.Tags.create_tag()
|
||||
|
||||
tag
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,26 @@
|
||||
defmodule Chesstrainer.ThemesFixtures do
|
||||
@moduledoc """
|
||||
This module defines test helpers for creating
|
||||
entities via the `Chesstrainer.Themes` context.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Generate a unique theme name.
|
||||
"""
|
||||
def unique_theme_name, do: "some name#{System.unique_integer([:positive])}"
|
||||
|
||||
@doc """
|
||||
Generate a theme.
|
||||
"""
|
||||
def theme_fixture(attrs \\ %{}) do
|
||||
{:ok, theme} =
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
category: :endgame,
|
||||
name: unique_theme_name()
|
||||
})
|
||||
|> Chesstrainer.Themes.create_theme()
|
||||
|
||||
theme
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user