Class: WireClient::BaseValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
lib/wire_client/base/validators.rb

Instance Method Summary collapse

Instance Method Details

#extract_field_name_value(record) ⇒ Object



5
6
7
8
9
10
# File 'lib/wire_client/base/validators.rb', line 5

def extract_field_name_value(record)
  field_name = options[:field_name] || self.class.default_field_name
  value = record.send(field_name).to_s

  [field_name, value]
end