From 033d07a519bac03fdfd28ca15e09cc287e80fd14 Mon Sep 17 00:00:00 2001 From: neodarz Date: Tue, 24 Jan 2017 17:09:18 +0100 Subject: Initial commit with non-functional pieces of code about file upload --- web/models/audio_file.ex | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 web/models/audio_file.ex (limited to 'web/models') diff --git a/web/models/audio_file.ex b/web/models/audio_file.ex new file mode 100644 index 0000000..46cf05f --- /dev/null +++ b/web/models/audio_file.ex @@ -0,0 +1,21 @@ +defmodule TheTranscriberBackend.AudioFile do + use TheTranscriberBackend.Web, :model + + schema "audio_file" do + field :audio_path, :string + field :transcription_file_path, :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, :transcription_file_path, :audio_duration]) + |> validate_required([:audio_path, :transcription_file_path, :audio_duration]) + end +end -- cgit v1.2.1