Skip to content
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

Move v4 UUID validation to an ActiveModel::EachValidator #17

Open
benjaminoakes opened this issue Feb 1, 2024 · 0 comments
Open

Move v4 UUID validation to an ActiveModel::EachValidator #17

benjaminoakes opened this issue Feb 1, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@benjaminoakes
Copy link
Contributor

return if uuid.match(REGEXP_UUID_V4)
TrackBallast.logger.tagged("invalid-uuid") do |logger|
logger.error(class: self.class.name, uuid: uuid, caller: caller.join("\n"))
end
errors.add :uuid, :not_v4_uuid, message: "is not a v4 UUID"

Related: #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant