From: Jean-Philippe Lang Date: Sat, 27 Jun 2015 07:11:41 +0000 (+0000) Subject: Sort journals by created_on then id (#14881). X-Git-Tag: 3.1.0~28 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b3aaabcb3cca85efba3caf7fc8c7b1cace041e25;p=redmine.git Sort journals by created_on then id (#14881). git-svn-id: http://svn.redmine.org/redmine/trunk@14374 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 2f7aa5315..80f02409a 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -96,7 +96,7 @@ class IssuesController < ApplicationController def show @journals = @issue.journals.includes(:user, :details). references(:user, :details). - reorder("#{Journal.table_name}.id ASC").to_a + reorder(:created_on, :id).to_a @journals.each_with_index {|j,i| j.indice = i+1} @journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project) Journal.preload_journals_details_custom_fields(@journals)