Sha256: ec2dd4937e0b531ffbb33f0c536700d75e46205ca71c621f243f9e0f31d3f28e

Contents?: true

Size: 289 Bytes

Versions: 1

Compression:

Stored size: 289 Bytes

Contents

class LongitudeValidator < ActiveModel::EachValidator

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

end

Version data entries

1 entries across 1 versions & 1 rubygems

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