# Will\_paginate, not overriding order on has\_many

**URL:** <https://www.ruby-forum.com/t/will-paginate-not-overriding-order-on-has-many/149741>\
**Category:** Rails\
**Created:** [September 29, 2008, 9:05am UTC](https://www.ruby-forum.com/t/will-paginate-not-overriding-order-on-has-many/149741 "2008-09-29T09:05:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stimpy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@stimpy](https://www.ruby-forum.com/u/stimpy)\
**Post date:** [September 29, 2008, 9:05am UTC](https://www.ruby-forum.com/t/will-paginate-not-overriding-order-on-has-many/149741/1 "2008-09-29T09:05:51Z")

</div>

I have a paginate call like this:

@person.chats.paginate :per\_page =\> 50, :page =\> params[:page], :order  
=\>  
“created\_at ASC”

which you’d think would order by created\_at in ascending order…

Wrong!

If I have has\_many :chats, :order =\> “created\_at DESC” on my Person  
model,  
it will attempt to do both and return a bastard set of results.

---

<div class="post-metadata">

**Author:** ![stimpy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@stimpy](https://www.ruby-forum.com/u/stimpy)\
**Post date:** [September 29, 2008, 9:42am UTC](https://www.ruby-forum.com/t/will-paginate-not-overriding-order-on-has-many/149741/2 "2008-09-29T09:42:11Z")

</div>

On Sep 29, 3:04 pm, “Ryan B. (Radar)” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> it will attempt to do both and return a bastard set of results.  
> Are you using Rails 2?
