Sha256: d029096ca292348e4025531da675d3f054fb301cf4a7935429e6692ac09e3ee5

Contents?: true

Size: 278 Bytes

Versions: 2

Compression:

Stored size: 278 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('yukonisuru.errors.messages.latitude'))
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yukonisuru-1.0.0 lib/yukonisuru/validators/latitude_validator.rb
yukonisuru-0.0.1 lib/yukonisuru/validators/latitude_validator.rb