rails validation presence of all attributes in a group or none

I am trying to validate the presence of banking data of a customer
( bank name, bank address, bank branch, ...)

If one of these fields is not blank then all other fields should be
filled...
Is there a smart way to validate it .. i.e validate presence of a
group of attributes ...

thanks fyfb

# in your model
validate :all_or_none_address_fields

def child_and_team_code_exists
  address_fields = [address1, address2, address3, town, county,
postcode] # these are all the attributes of the model you want all or
none of
   errors.add_to_base("All of the address fields need a value if any
of them are entered") if
   address_fields.any? && !address_fields.all?
end