Module: ActiveModel::Validations::ClassMethods

Defined in:
lib/swiss_bank_validator/validates_bank_field_of.rb,
lib/swiss_bank_validator/validates_iban_format_of.rb

Instance Method Summary collapse

Instance Method Details

#validates_bank_field_of(*attr_names) ⇒ Object Also known as: validates_bank_field

Validates whether or not the specified field bank complient.

class Account < ActiveRecord::Base
  validates_bank_field_of :name
end


27
28
29
# File 'lib/swiss_bank_validator/validates_bank_field_of.rb', line 27

def validates_bank_field_of(*attr_names)
  validates_with BankFieldValidator, _merge_attributes(attr_names)
end

#validates_iban_format_of(*attr_names) ⇒ Object Also known as: validates_iban

Validates whether or not the specified iban is valid.

class Account < ActiveRecord::Base
  validates_iban_format_of :iban
end


97
98
99
# File 'lib/swiss_bank_validator/validates_iban_format_of.rb', line 97

def validates_iban_format_of(*attr_names)
  validates_with IbanValidator, _merge_attributes(attr_names)
end