Fix user/deepl_account relation
This commit is contained in:
@ -9,8 +9,7 @@ defmodule Outlook.Translators.DeeplAccount do
|
||||
field :description, :string
|
||||
field :name, :string
|
||||
field :our_character_count, :integer
|
||||
field :user_id, :id
|
||||
belongs_to :users, User
|
||||
belongs_to :user, Outlook.Accounts.User
|
||||
|
||||
timestamps()
|
||||
end
|
||||
@ -18,7 +17,7 @@ defmodule Outlook.Translators.DeeplAccount do
|
||||
@doc false
|
||||
def changeset(deepl_account, attrs) do
|
||||
deepl_account
|
||||
|> cast(attrs, [:name, :description, :auth_key, :character_limit, :character_count, :our_character_count])
|
||||
|> validate_required([:name, :description, :auth_key, :character_limit])
|
||||
|> cast(attrs, [:name, :description, :auth_key, :character_limit, :character_count, :our_character_count, :user_id])
|
||||
|> validate_required([:name, :description, :auth_key, :character_limit, :user_id])
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user