Postgres JSON data type Rails query
For any who stumbles upon this. I have come up with a list of queries using ActiveRecord and Postgres’ JSON data type. Feel free to edit this to make it more clear. Documentation to the JSON operators used below: https://www.postgresql.org/docs/current/functions-json.html. # Sort based on the Hstore data: Post.order(“data->’hello’ DESC”) => #<ActiveRecord::Relation [ #<Post id: 4, … Read more