开发者

unscope only the order statements

How can i unscope all the ORDER BY sql statemnts in rails 3?

cha开发者_高级运维in.unscoped.order("id ASC")

problem that i have is that this will also drop the WHERE statements and my query is meaningless without them. something like .unscoped('order') would be nice.


You can use the except() method.

chain.except(:order)

I think that'll do what you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜