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"=>"[email protected]"},
{"name"=>"Fabien", "email"=>"[email protected]"},]
id: 2,
subject: "World",
participants:
[{"name"=>"guillaume", "email"=>"[email protected]"},
{"name"=>"hakim", "email"=>"[email protected]"},]
participants is a JSONB array column
I want to find records who have the email "[email protected]" in participants column.
Theadwill clash with the Ruby core class. Use a different name or define it in a namespace (a module) unless you want to risk some pretty horrenduos bugs.