I have a model, called Order, to which I'd like to add a new jsonb column called status_updates. This column will contain data of the following format:
status_updates = [{ status: 'success', created_at: <timestamp> }, { status: 'processing', created_at: <timestamp> }]
I would like to validate the status attribute of each status_updates element is one of the following: success, canceled, processing. Additionally, I'd like to validate that each element has a created_at timestamp.
How would you do that in Rails? Is it possible to do something similar to enum for the statuses?