From c3b7662cac430d94e96810b09b8c11b603c398be Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 31 Dec 2015 15:17:48 +0800 Subject: [PATCH] =?UTF-8?q?issue=E6=8C=89=E6=9B=B4=E6=96=B0=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 2 +- app/models/journal.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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