I've found plenty of posts around how to validate a field is present, if another condition is true, such as these:
Rails: How to validate format only if value is present?
Rails - Validation :if one condition is true
However, how do I do it the opposite way around?
My User has an attribute called terms_of_service
.
How do I best write a validation that checks that the terms_of_service == true
, if present?