我是 Rails 的新手。我有一个名为 OfflineExport 的模型。在表中我有这样的数据
#<OfflineExport id: 2,
parameters:
{"project_id"=>"3",
"type"=>"submissions",
"filters"=>{"task_type"=>"",
"corrections"=>"", "grade"=>"",
"min_duration"=>"", "after"=>"",
"max_duration"=>"", "reviews"=>"",
"before"=>""},
"send_email"=>"true",
"options"=>{"offline_record_id"=>2}}>
我试图在 where 子句中获取参数 [“project_id”]
OfflineExport.where("parameters[project_id] = '3'")
但我收到如下错误:
ActiveRecord::StatementInvalid: PGError: ERROR: cannot subscript type text because it is not an array
谁能帮我解决这个问题?