Relax ScrobbleRule.t to allow unpersisted structs
This commit is contained in:
@@ -49,7 +49,7 @@ defmodule MusicLibrary.ScrobbleRules do
|
||||
def get_scrobble_rule!(id), do: Repo.get!(ScrobbleRule, id)
|
||||
|
||||
@spec create_scrobble_rule(map()) :: {:ok, ScrobbleRule.t()} | {:error, Ecto.Changeset.t()}
|
||||
def create_scrobble_rule(attrs \\ %{}) do
|
||||
def create_scrobble_rule(attrs) do
|
||||
%ScrobbleRule{}
|
||||
|> ScrobbleRule.changeset(attrs)
|
||||
|> Repo.insert()
|
||||
|
||||
@@ -5,9 +5,9 @@ defmodule MusicLibrary.ScrobbleRules.ScrobbleRule do
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
id: integer() | nil,
|
||||
type: :album | :artist,
|
||||
match_value: String.t(),
|
||||
target_musicbrainz_id: String.t(),
|
||||
type: :album | :artist | nil,
|
||||
match_value: String.t() | nil,
|
||||
target_musicbrainz_id: String.t() | nil,
|
||||
enabled: boolean(),
|
||||
description: String.t() | nil,
|
||||
inserted_at: DateTime.t() | nil,
|
||||
|
||||
Reference in New Issue
Block a user