Method: Webhookdb::Postgres::Validations#validates_exactly_one_of
- Defined in:
- lib/webhookdb/postgres/validations.rb
#validates_exactly_one_of(*cols, predicate: :nil?) ⇒ Object
Ensures that one and only one of the passed columns is not nil.
33 34 35 36 |
# File 'lib/webhookdb/postgres/validations.rb', line 33 def validates_exactly_one_of(*cols, predicate: :nil?) self.validates_at_least_one_of(*cols, predicate:) self.validates_mutually_exclusive(*cols, predicate:) end |