Ruby on Rails: Enforcing “All or None” Field Presence with Conditional Validations
Understanding the Requirement Let’s say we have a Payment model with the following attributes: account_number routing_number swift_code We want to enforce that if any one of these fields ...