aboutsummaryrefslogtreecommitdiff
path: root/web/models/audio_file.ex
blob: f7be8de97931e52f1aa6bd68325938b118e0577e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
defmodule TheTranscriberBackend.AudioFile do
  use TheTranscriberBackend.Web, :model

  schema "audio_file" do
    field :audio_path, :string
    field :audio_name, :string
    field :audio_duration, :string

    timestamps()
  end

  @doc """
  Builds a changeset based on the `struct` and `params`.
  """

  def changeset(struct, params \\ %{}) do
    struct
    |> cast(params, [:audio_path, :audio_name, :audio_duration])
    |> validate_required([:audio_path, :audio_name, :audio_duration])
  end
end