diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 77dc1a9aa..c3f926867 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -85,7 +85,7 @@ class IssuesController < ApplicationController params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1 @offset ||= @issue_pages.offset @issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version], - :order => sort_clause, + :order => 'issues.updated_on desc', :offset => @offset, :limit => @limit) if params[:set_filter] diff --git a/app/models/journal.rb b/app/models/journal.rb index 638a98006..a66c4327a 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -17,10 +17,10 @@ class Journal < ActiveRecord::Base include UserScoreHelper - belongs_to :journalized, :polymorphic => true + belongs_to :journalized, :polymorphic => true,:touch => true # added as a quick fix to allow eager loading of the polymorphic association # since always associated to an issue, for now - belongs_to :issue, :foreign_key => :journalized_id + belongs_to :issue, :foreign_key => :journalized_id,:touch => true belongs_to :user has_many :details, :class_name => "JournalDetail", :dependent => :delete_all