Validation that tests relationship value (without using custom validator?)

Ahh! In this case, the sprint is not nil.

But thanks to your note, I realized there are tests in the test suite where it would be nil to protect against a bad state. That’s what’s triggering the warning.

Adding a guard fixes it in the validation – but that raises an interesting question. There are constraints in place that prevent setting the sprint to nil. It hadn’t occurred to me that the validation would run before the constraints. Is there any way to postpone the validations until after constraints are checked?

Specifically, the belongs_to relationship is allow_nil? false.