Skip to content

Commit

Permalink
Update validator message
Browse files Browse the repository at this point in the history
  • Loading branch information
phildionne committed May 9, 2015
1 parent 8ce6a20 commit a702bc3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ end

feature = Feature.new(data: data)
feature.valid?
feature.errors[:data] # => ["Invalid geojson"]
feature.errors[:data] # => ["Geojson is invalid""]
```

## Installation
Expand Down
2 changes: 1 addition & 1 deletion lib/geojsonlint/geojson_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class GeojsonValidator < ActiveModel::EachValidator

def validate_each(record, attribute, value)
unless valid_geojson?(value)
message = options[:message] || "invalid"
message = options[:message] || "is invalid"
record.errors.add(attribute, message)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/geojsonlint/geojson_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def initialize(params={})
end

it "populates errors :geojson with 'Invalid geojson'" do
expect(feature.errors[:geojson]).to eq(['Invalid geojson'])
expect(feature.errors[:geojson]).to eq(['is invalid'])
end
end
end
Expand Down

0 comments on commit a702bc3

Please sign in to comment.