issue按更新时间排序

This commit is contained in:
lizanle 2015-12-31 15:17:48 +08:00
parent fccbbe6e2b
commit c3b7662cac
2 changed files with 3 additions and 3 deletions

View File

@ -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]

View File

@ -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