X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/98bfaace9aeba7fb387596cc16b2e661506173c6..5058e7d748334f4d2c435d7818d7b55537739d1e:/app/controllers/api/changeset_comments_controller.rb diff --git a/app/controllers/api/changeset_comments_controller.rb b/app/controllers/api/changeset_comments_controller.rb index bb77e1106..4a96ec3bb 100644 --- a/app/controllers/api/changeset_comments_controller.rb +++ b/app/controllers/api/changeset_comments_controller.rb @@ -1,7 +1,6 @@ module Api class ChangesetCommentsController < ApiController before_action :check_api_writable - before_action :check_api_readable, :except => [:create] before_action :authorize authorize_resource @@ -42,7 +41,7 @@ module Api # Return a copy of the updated changeset @changeset = changeset - render "api/changesets/changeset" + render "api/changesets/show" respond_to do |format| format.xml @@ -67,7 +66,7 @@ module Api # Return a copy of the updated changeset @changeset = comment.changeset - render "api/changesets/changeset" + render "api/changesets/show" respond_to do |format| format.xml @@ -92,7 +91,7 @@ module Api # Return a copy of the updated changeset @changeset = comment.changeset - render "api/changesets/changeset" + render "api/changesets/show" respond_to do |format| format.xml @@ -105,7 +104,7 @@ module Api ## # Check if the current user has exceed the rate limit for comments def rate_limit_exceeded? - recent_comments = current_user.changeset_comments.where("created_at >= ?", Time.now.utc - 1.hour).count + recent_comments = current_user.changeset_comments.where(:created_at => Time.now.utc - 1.hour..).count recent_comments >= current_user.max_changeset_comments_per_hour end