【发布时间】:2016-02-19 14:12:27
【问题描述】:
在 postgres json 字段中,如何使用 ActiveRecord 查询匹配 item["editions"] 包括 23 的所有数组项?
Topic.create!(
tree: [
{
"title" => "Title 1",
"description" => "Description",
"editions" => [23],
}
{
"title" => "Title 2",
"description" => "Description",
"editions" => [12],
}
]
)
【问题讨论】:
标签: ruby-on-rails json rails-activerecord postgresql-9.1