From 734cf330bac3eb717ecfe7e70406a849decaace7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Rodrigues?= Date: Wed, 9 Aug 2023 22:20:59 +0100 Subject: [PATCH] Implement suggestions --- lib/atomic/departments.ex | 2 +- lib/atomic/organizations/collaborator.ex | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/atomic/departments.ex b/lib/atomic/departments.ex index f47f71383..ca455f60f 100644 --- a/lib/atomic/departments.ex +++ b/lib/atomic/departments.ex @@ -201,7 +201,7 @@ defmodule Atomic.Departments do """ def create_collaborator(attrs \\ %{}, _after_save \\ &{:ok, &1}) do %Collaborator{} - |> Collaborator.create_changeset(attrs) + |> Collaborator.changeset(attrs) |> Repo.insert() end diff --git a/lib/atomic/organizations/collaborator.ex b/lib/atomic/organizations/collaborator.ex index 33a01be0c..97f017dc3 100644 --- a/lib/atomic/organizations/collaborator.ex +++ b/lib/atomic/organizations/collaborator.ex @@ -22,10 +22,4 @@ defmodule Atomic.Organizations.Collaborator do |> cast(attrs, @required_fields ++ @optional_fields) |> validate_required(@required_fields) end - - def create_changeset(collaborator_departments, attrs) do - collaborator_departments - |> cast(attrs, @required_fields) - |> validate_required(@required_fields) - end end