Search code examples
ruby-on-railsruby-on-rails-4paper-trail-gem

Default sort versions with papertrail


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')

Solution

  • Well I found that I could just use reverse in my each do block.

    versions.reverse.each

    Since I need nothing more complex than that I guess it will do for now.