Skip to content

Commit 088fa96

Browse files
committed
remove choices from validate_required
""" warning: attempting to determine the presence of embed_many field :choices with validate_required/3 ... which has no effect. You can pass the :required option to Ecto.Changeset.cast_embed/3 to achieve this. """
1 parent 50aed9f commit 088fa96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/cadet/assessments/question_types/mcq_question.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defmodule Cadet.Assessments.QuestionTypes.MCQQuestion do
2020
|> cast(params, @required_fields)
2121
|> cast_embed(:choices, with: &MCQChoice.changeset/2, required: true)
2222
|> validate_one_correct_answer
23-
|> validate_required(@required_fields ++ ~w(choices)a)
23+
|> validate_required(@required_fields)
2424
end
2525

2626
defp validate_one_correct_answer(changeset) do

0 commit comments

Comments
 (0)