From aa1c61308805d0569803c1f70b36d7c333bdd50a Mon Sep 17 00:00:00 2001 From: Fahrradflucht Date: Tue, 4 Oct 2016 23:01:05 +0200 Subject: [PATCH] Add :description to required fields on organisation changesets. As mentioned in 5b951c1a510c86e4877b18c0766fc65c290c9e53 did 5e6b235c3078f9dbacfa5295e27b5b3fc770a1d0 introduce a not null contraint on the organization description. This adds the description to the required fields on the organization changesets so it is possible to catch the constraint early. --- web/models/organization.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/models/organization.ex b/web/models/organization.ex index 247994404..56403db1e 100644 --- a/web/models/organization.ex +++ b/web/models/organization.ex @@ -35,7 +35,7 @@ defmodule CodeCorps.Organization do def changeset(struct, params \\ %{}) do struct |> cast(params, [:name, :description, :slug, :base64_icon_data]) - |> validate_required([:name]) + |> validate_required([:name, :description]) |> upload_image(:base64_icon_data, :icon) end @@ -46,7 +46,7 @@ defmodule CodeCorps.Organization do struct |> changeset(params) |> generate_slug(:name, :slug) - |> validate_required([:slug]) + |> validate_required([:slug, :description]) |> validate_slug(:slug) |> put_slugged_route() end