issue按更新时间排序
This commit is contained in:
parent
fccbbe6e2b
commit
c3b7662cac
|
@ -85,7 +85,7 @@ class IssuesController < ApplicationController
|
||||||
params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1
|
params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1
|
||||||
@offset ||= @issue_pages.offset
|
@offset ||= @issue_pages.offset
|
||||||
@issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
|
@issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
|
||||||
:order => sort_clause,
|
:order => 'issues.updated_on desc',
|
||||||
:offset => @offset,
|
:offset => @offset,
|
||||||
:limit => @limit)
|
:limit => @limit)
|
||||||
if params[:set_filter]
|
if params[:set_filter]
|
||||||
|
|
|
@ -17,10 +17,10 @@
|
||||||
|
|
||||||
class Journal < ActiveRecord::Base
|
class Journal < ActiveRecord::Base
|
||||||
include UserScoreHelper
|
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
|
# added as a quick fix to allow eager loading of the polymorphic association
|
||||||
# since always associated to an issue, for now
|
# 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
|
belongs_to :user
|
||||||
has_many :details, :class_name => "JournalDetail", :dependent => :delete_all
|
has_many :details, :class_name => "JournalDetail", :dependent => :delete_all
|
||||||
|
|
Loading…
Reference in New Issue