f90089e1bf
Use Upload Media logic from Pleroma Backend changes for picture upload Move AS <-> Model conversion to separate module Front changes Downgrade apollo-client: https://github.com/Akryum/vue-apollo/issues/577 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
22 lines
377 B
Elixir
22 lines
377 B
Elixir
defmodule Mobilizon.Media.Picture do
|
|
@moduledoc """
|
|
Represents a picture entity
|
|
"""
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
alias Mobilizon.Media.File
|
|
|
|
schema "pictures" do
|
|
embeds_one(:file, File, on_replace: :update)
|
|
|
|
timestamps()
|
|
end
|
|
|
|
@doc false
|
|
def changeset(picture, attrs) do
|
|
picture
|
|
|> cast(attrs, [])
|
|
|> cast_embed(:file)
|
|
end
|
|
end
|