Sha256: 74e7882a470759968d1998f6618e481bf7647c2b6d0c83bac7ebb96cc4b02da4

Contents?: true

Size: 288 Bytes

Versions: 5

Compression:

Stored size: 288 Bytes

Contents

class EffectiveAddressFullNamePresenceValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    if value.present? && value.full_name.blank?
      record.errors[attribute] << "is invalid"
      value.errors[:full_name] << "can't be blank" 
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
effective_addresses-1.0.4 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.0.3 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.0.2 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.0.1 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.0.0 app/models/validators/effective_address_full_name_presence_validator.rb