0
我已經把下面的查詢,因爲我期待它其中工程:軌道/活動記錄找到加盟,限制和抵消
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
但是這會引發數據庫錯誤。什麼是寫這個查詢的正確方法?
我覺得你應該使用AREL,u能easiely consruct相同詢問 –