frenzy/lib/frenzy/group.ex

20 lines
329 B
Elixir

defmodule Frenzy.Group do
use Ecto.Schema
import Ecto.Changeset
schema "groups" do
field :title, :string
has_many :feeds, Frenzy.Feed, on_delete: :delete_all
timestamps()
end
@doc false
def changeset(group, attrs) do
group
|> cast(attrs, [:title])
|> validate_required([:title])
end
end