0

我正在尝试使用 Squeel 来比较连接表之间的属性以及一些数学运算。

下面是一个查询示例:

Parent.joins{[child1, child2.grandchildren]}.
where{grandchildren.birth_datetime > Time.now - child1.age.years}

我从 Squeel 收到一条错误消息,提示“TypeError: can't convert Squeel::Nodes::KeyPath into an exact number”

有人知道我在这里做错了什么吗?

4

1 回答 1

0

Parent.
  joins{[child1, child2.grandchildren]}.
  where{child2.grandchildren.birth_datetime > (Time.current - child1.age.years)}

做这个把戏?

于 2012-11-27T08:22:01.707 回答