【发布时间】:2014-09-13 20:29:00
【问题描述】:
我正在尝试将有效的 SQL 语句转换为 ActiveRecord 查询。下面是我设置的当前查询,但是当我执行它时出现以下错误,任何可以帮助我找出调试步骤吗?
错误
RuntimeError: unknown class: Fixnum
查询
Contestant.joins('INNER JOIN votes AS V on V.contestant_id = contestants.id LEFT JOIN votes as XV on XV.contestant_id = (?) and XV.tribal_council_key = V.tribal_council_key and XV.contestant_voted_for_id = V.contestant_voted_for_id', self.id)
.where('V.is_jury_vote = (?) AND V.contestant_id <> (?)', :false, self.id)
.group('V.contestant_id')
.having('count(XV.tribal_council_key) > (?)', :false)
如果我需要提供更多信息,请告诉我。
【问题讨论】:
标签: ruby-on-rails join rails-activerecord