Sha256: a49bb929488145c1b39098e605ec5d809dda86da986170483b5a523053ee18d9

Contents?: true

Size: 304 Bytes

Versions: 20

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

20 entries across 20 versions & 1 rubygems

Version Path
effective_addresses-1.5.0 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.4.1 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.4.0 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.3.9 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.3.8 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.3.7 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.3.6 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.3.5 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.3.4 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.3.2 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.3.1 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.3.0 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.2.4 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.2.3 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.2.2 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.2.1 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.2.0 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.1.0 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.0.6 app/models/validators/effective_address_full_name_presence_validator.rb
effective_addresses-1.0.5 app/models/validators/effective_address_full_name_presence_validator.rb