Sha256: dd63e00d6ad1de62ad3c42d21869d4fe231b369aca1226a96b8e4313d18a7563

Contents?: true

Size: 304 Bytes

Versions: 38

Compression:

Stored size: 304 Bytes

Contents

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

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
effective_addresses-1.11.5 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.11.2 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.11.1 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.11.0 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.10.4 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.10.3 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.10.2 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.10.1 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.10.0 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.9.11 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.9.10 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.9.9 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.9.8 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.9.7 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.9.6 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.9.5 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.9.4 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.9.3 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.9.2 lib/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.9.1 app/models/validators/effective_address_full_name_presence_validator.rb