【发布时间】:2021-06-10 04:35:41
【问题描述】:
我有一个简单的时间跟踪器,只是尝试编写一个满足以下条件的查询并使用以下内容提取所有记录:user_id = 6 AND(is_paused 为 true 或 manual_input_hours 为 nil)。
根据我尝试的结构如下
Timerecord.where(user_id: 6).where(Timerecord.where(is_paused: true).or(Timerecord.where.not(manual_input_hours: 0)))
但它不起作用,出现以下错误:不支持的参数类型:#Timerecord::ActiveRecord_Relation:0x000056546f549358 (Timerecord::ActiveRecord_Relation) (ArgumentError)
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-6