Skip to content

Instantly share code, notes, and snippets.

@talum
Created May 28, 2019 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talum/470d5b90aaa49406bf7519d62b23230c to your computer and use it in GitHub Desktop.
Save talum/470d5b90aaa49406bf7519d62b23230c to your computer and use it in GitHub Desktop.
Paid Changeset
defmodule Registrar.Billing.Invoice do
import Ecto.Changeset
def mark_paid_changeset(%Invoice{} = invoice, attrs \\ %{}) do
  invoice
  |> cast(attrs, [
   :paid_at
  ])
  |> validate_required([
   :paid_at
  ])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment