Sha256: 58404043b4f68f9ecf410f6f83a783058e583d8fbf5f5df7517aee2bffbdd550

Contents?: true

Size: 285 Bytes

Versions: 1

Compression:

Stored size: 285 Bytes

Contents

class LatitudeValidator < ActiveModel::EachValidator

  def validate_each(record, attribute, value)
    unless value.present? && value >= -90 && value <= 90
      record.errors[attribute] << (options[:message] || I18n.t('active_validation.errors.messages.latitude'))
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_validation-1.0.0 lib/active_validation/validators/latitude_validator.rb