Skip to content

Instantly share code, notes, and snippets.

View croaker's full-sized avatar

Daniel Gruenthal croaker

  • Hamburg, Germany
View GitHub Profile
@croaker
croaker / gitmessage
Created November 13, 2018 16:45
Commit Message Template
# 50-character subject line
#
# 72-character wrapped longer description. This should answer:
#
# * Why was this change necessary?
# * How does it address the problem?
# * Are there any side effects?
#
# Include a link to the ticket, if any.
#
@croaker
croaker / 1 README.md
Last active March 12, 2020 13:30
A JsonValidator for ActiveModel using json-schema

JsonValidator

A simple validator to validate jsonb columns against a JSON schema. It's dependent on the json-schema gem, make sure to add gem 'json-schema' to your Gemfile and run $ bundle.

To use this, add json_validator.rb to app/models/concerns and json_validator_spec.rb to spec/models/concerns. By convention, schemas are stored in app/models/json_schemas.

Example