]> cat aescling's git repositories - mastodon.git/commitdiff
Fix scope latest of ReportNote (#9630)
authorysksn <bluewhale1982@gmail.com>
Wed, 26 Dec 2018 05:38:59 +0000 (14:38 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 26 Dec 2018 05:38:59 +0000 (06:38 +0100)
app/models/report_note.rb

index 54b416577a14ee3f176a654188977599c8a1f084..6d7167e0edbc8cb9fa63cfa9774ae53a599ebe39 100644 (file)
@@ -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