mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-03 16:17:59 +01:00
23 lines
465 B
Elixir
23 lines
465 B
Elixir
defmodule Philomena.ImageFeatures.ImageFeature do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
alias Philomena.Images.Image
|
|
alias Philomena.Users.User
|
|
|
|
@primary_key false
|
|
|
|
schema "image_features" do
|
|
belongs_to :image, Image
|
|
belongs_to :user, User
|
|
|
|
timestamps(inserted_at: :created_at, type: :utc_datetime)
|
|
end
|
|
|
|
@doc false
|
|
def changeset(image_feature, attrs) do
|
|
image_feature
|
|
|> cast(attrs, [])
|
|
|> validate_required([])
|
|
end
|
|
end
|