I'm using the paper_trail gem in my Rails 4 application and I want to set a default sort order. papertrail doesn't have a model, only a controller and an initializer.
Where can I put it? Do I have to create a model for it?
default_scope order('created_at DESC')
There's also the reorder command.
http://apidock.com/rails/ActiveRecord/QueryMethods/reorder
versions.reorder('created_at DESC')
It will replace any prior ordering, thus ignoring Papertrail's pre-defined order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With