Add documentation about jsonb_accessor gem
In !123380 (merged), we added a gem jsonb_accessors
that allows use to ActiveRecord validations. This is an addition to JsonSchemaValidator
We introduced this because the ApplicationSettings
and OrganizationSettings
have complex validations:
- Custom error messages for UI purposes
- Validations against values defined in code
- Validations using methods
The documentation for storing JSON in the database at https://docs.gitlab.com/ee/development/migration_style_guide.html#storing-json-in-database should be updated:
- Add this gem as an alternative
- Short code example
- Guidelines: when should a developer use
JsonSchemaValidator
orjsonb_accessors
Edited by Rutger Wessels