2
假设我们有我们的控制器中的某个地方有@posts = Post.published.per(10).page(params[:page])
。稍后我们需要更新所有发布的帖子(Post.published
)。有没有办法从ActiveRelation对象中移除分页?
应该怎么去除分页?
@posts.limit(false).offset(false)
似乎在做的伎俩,但我认为应该有一些其他方式,更高层次的方式(如@posts.without_pagination
)。