]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/changeset_comments_controller.rb
Remove unnecessary user menu wrapper
[rails.git] / app / controllers / api / changeset_comments_controller.rb
index 756e56dccdfb706d8d6e7c4456683fcc232eb08c..e8d3f4c3a8df2c5dbcc1ae77f864d77057846449 100644 (file)
@@ -105,7 +105,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