Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- defmodule Kpsz.Event do
- use Kpsz.Web, :model
- schema "events" do
- field :name, :string
- field :description, :string
- field :location, Kpsz.Point
- has_many :pressences, Kpsz.Pressence
- timestamps()
- end
- @doc """
- Builds a changeset based on the `struct` and `params`.
- """
- def changeset(struct, params \\ %{}) do
- struct
- |> cast(params, [:name, :description, :location])
- |> validate_required([:name, :description, :location])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement