From 84c57ebecde78151f91f6bcd919ef507735c77bc Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Tue, 6 Oct 2026 14:41:01 +0900 Subject: [PATCH] Sort journal details by id so that they are always displayed in the order they were added --- app/models/journal.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/journal.rb b/app/models/journal.rb index 1874feb0c..8435ec069 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -28,7 +28,7 @@ class Journal < ApplicationRecord belongs_to :user belongs_to :updated_by, :class_name => 'User' - has_many :details, :class_name => "JournalDetail", :dependent => :delete_all, :inverse_of => :journal + has_many :details, lambda {order(:id)}, :class_name => "JournalDetail", :dependent => :delete_all, :inverse_of => :journal attr_accessor :indice acts_as_event( -- 2.55.0