fix pool version ordering

This commit is contained in:
albert 2013-02-21 16:48:46 -05:00
parent 9af5959629
commit d7fb091bd1
2 changed files with 12 additions and 1 deletions

View File

@ -1,6 +1,6 @@
class PoolVersionsController < ApplicationController
def index
@search = PoolVersion.search(params[:search])
@pool_versions = @search.order("id desc").paginate(params[:page])
@pool_versions = @search.order("updated_at desc").paginate(params[:page])
end
end

View File

@ -0,0 +1,11 @@
class AddIndexUpdatedAtOnPoolVersions < ActiveRecord::Migration
def up
execute "set statement_timeout = 0"
add_index :post_versions, :updated_at
end
def down
execute "set statement_timeout = 0"
remove_index :post_versions, :updated_at
end
end