X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/94b59f440321846760d430fee378f05a6a2803ee..b5c72bb6d7416848cce62efde99341b6b99c5005:/app/controllers/changeset_comments_controller.rb diff --git a/app/controllers/changeset_comments_controller.rb b/app/controllers/changeset_comments_controller.rb index 05b28eacf..637ac7be6 100644 --- a/app/controllers/changeset_comments_controller.rb +++ b/app/controllers/changeset_comments_controller.rb @@ -4,7 +4,7 @@ class ChangesetCommentsController < ApplicationController authorize_resource - before_action(:only => [:index]) { |c| c.check_database_readable(true) } + before_action -> { check_database_readable(:need_api => true) } around_action :web_timeout ## @@ -18,7 +18,7 @@ class ChangesetCommentsController < ApplicationController changeset = Changeset.find(id) # Return comments for this changeset only - @comments = changeset.comments.includes(:author, :changeset).limit(comments_limit) + @comments = changeset.comments.includes(:author, :changeset).reverse_order.limit(comments_limit) else # Return comments @comments = ChangesetComment.includes(:author, :changeset).where(:visible => true).order("created_at DESC").limit(comments_limit).preload(:changeset)