我整理了以下查询,它按我的预期工作:
stuff = @thing.children.find(
:all,
:joins => :other,
:conditions => {:others => {:another_id => some_id}},
:limit => my_limit,
:offset => my_offset,
)
但是,find(:all)
不推荐使用表单查询。我尝试将查询更改为以下形式:
stuff = @thing.children.find(
:joins => :other,
:conditions => {:others => {:another_id => some_id}},
:limit => my_limit,
:offset => my_offset,
).all
但这会引发数据库错误。编写此查询的正确方法是什么?