Update DeeplAccount
Less required fields, default for character_count and association.
This commit is contained in:
@ -4,12 +4,13 @@ defmodule Outlook.Translators.DeeplAccount do
|
||||
|
||||
schema "deepl_accounts" do
|
||||
field :auth_key, :string
|
||||
field :character_count, :integer
|
||||
field :character_count, :integer, default: 0
|
||||
field :character_limit, :integer
|
||||
field :description, :string
|
||||
field :name, :string
|
||||
field :our_character_count, :integer
|
||||
field :user_id, :id
|
||||
belongs_to :users, User
|
||||
|
||||
timestamps()
|
||||
end
|
||||
@ -18,6 +19,6 @@ defmodule Outlook.Translators.DeeplAccount do
|
||||
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, :character_count, :our_character_count])
|
||||
|> validate_required([:name, :description, :auth_key, :character_limit])
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user