How to use active record to query an array of jsonb objects
Schema
create_table "routes", force: :cascade do |t|
t.string "state"
t.text "address"
t.bigint "user_id", null: false
t.jsonb "travel_routes", array: true
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["user_id"], name: "index_routes_on_user_id"
end
Rails Console
travel_routes: [{"to"=>"Yaba Lagos", "fee"=>5000}, {"to"=>"Lagos Iyanapaja", "fee"=>3000}]