I'm on Ruby On Rails 7
I have a class ActiveRecord class called Thread
.
There are 2 records :
id: 1,
subject: "Hello",
participants:
[{"name"=>"guillaume", "email"=>"guillaume@example.com"},
{"name"=>"Fabien", "email"=>"fabien@example.com"},]
id: 2,
subject: "World",
participants:
[{"name"=>"guillaume", "email"=>"guillaume@example.com"},
{"name"=>"hakim", "email"=>"hakim@example.com"},]
participants
is a JSONB array column
I want to find records who have the email "hakim@example.com" in participants
column.