-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor: resources validators #138
Refactor: resources validators #138
Conversation
af17723
to
46d1b9f
Compare
29f3527
to
a998a4e
Compare
merging this and #139 |
Hi @mdorf, Thanks, for merging all the PRs. Just for your information, this PR changes the behavior of the URI validator making it more strict. Before a URI is valid if the value is of type RDF::URI, accepting empty strings and no valid URLs. Now a URI is valid if it is a valid URL, not empty and valid So you need to take a particular look if you don't have this sort of erroneous data (empty strings and no valid URLs) in Bioportal and fix them manually using NCBO cron. value.is_a?(RDF::URI) && value.valid? to value.is_a?(RDF::URI) |
lets see if this this will address ncbo/bioportal_web_ui#57 |
Context
See agroportal/project-management#339
Changes
Add unit tests for all our validators (8cfd2f7)
Add an abstraction to define validators (85ca3a5)
Implement it for Data types (String, URI, Integer, Float, DateTime, Float, and list)(56adaf6)
test
or 'test/test' will no more be valid)Implement it for uniqueness validator (cd67a52)
existent?
test (6091f1a and a998a4e)implement if for existence validator (27fffc1)
[]
) and URIsImplement if for Object types (887653c)
Implement it for range validator (9227510)
enforce: [:min_2, :max_5]
will enforce the value to be in that range)Refactor the enforce module, to be more succinct (by extracting reusable sections)(2d1457d)