Problem
When a Task has archived: true in its changeset, the TaskList association should be made optional.
- change
order_task in Task.changeset to set_order and from that function:
- add
validate_required([:task_list_id]) here instead of the main changeset
- call
order_task if archived: false
- set the
order to NULL if archived: false
- add tests for the changesets
Problem
When a
Taskhasarchived: truein its changeset, theTaskListassociation should be made optional.order_taskinTask.changesettoset_orderand from that function:validate_required([:task_list_id])here instead of the mainchangesetorder_taskifarchived: falseordertoNULLifarchived: false