Skip to content

Instantly share code, notes, and snippets.

@liwh
Created September 1, 2010 07:10
Show Gist options
  • Save liwh/560346 to your computer and use it in GitHub Desktop.
Save liwh/560346 to your computer and use it in GitHub Desktop.

今天,对多个实体查询去重,发现直接用uniq就可以了,如:
Conversation.search(:params[:search]).uniq.paginate
就行了,而且有分页的效果,但是:查看后台日志中的sql语句,并没有看到其产生limit语句。为什么却实现了分页?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment