From 09b6bf49ee6a80c31b01ea202fee26bbbe34fdc4 Mon Sep 17 00:00:00 2001 From: ysksn Date: Wed, 26 Dec 2018 14:38:59 +0900 Subject: [PATCH] Fix scope latest of ReportNote (#9630) --- app/models/report_note.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/report_note.rb b/app/models/report_note.rb index 54b416577a..6d7167e0ed 100644 --- a/app/models/report_note.rb +++ b/app/models/report_note.rb @@ -15,7 +15,7 @@ class ReportNote < ApplicationRecord belongs_to :account belongs_to :report, inverse_of: :notes, touch: true - scope :latest, -> { reorder('created_at ASC') } + scope :latest, -> { reorder(created_at: :desc) } validates :content, presence: true, length: { maximum: 500 } end