Class: GeojsonValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/geojsonlint/geojson_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



7
8
9
10
11
12
# File 'lib/geojsonlint/geojson_validator.rb', line 7

def validate_each(record, attribute, value)
  unless valid_geojson?(value)
    message = options[:message] || "is invalid"
    record.errors.add(attribute, message)
  end
end