]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/changeset_comments_controller.rb
Merge remote-tracking branch 'upstream/pull/5140'
[rails.git] / app / controllers / api / changeset_comments_controller.rb
index 756e56dccdfb706d8d6e7c4456683fcc232eb08c..4a96ec3bbaef00087e8b03a464c7ee78e65c56c2 100644 (file)
@@ -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
@@ -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