]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/messages_controller.rb
Merge remote-tracking branch 'upstream/pull/4822'
[rails.git] / app / controllers / messages_controller.rb
index d231fddde32945eff8a7454e3d7a09d37318bfc6..adfbd9157992537c18c35b35beb1c67513dbef03 100644 (file)
@@ -42,7 +42,7 @@ class MessagesController < ApplicationController
     @message.sender = current_user
     @message.sent_on = Time.now.utc
 
-    if current_user.sent_messages.where("sent_on >= ?", Time.now.utc - 1.hour).count >= current_user.max_messages_per_hour
+    if current_user.sent_messages.where(:sent_on => Time.now.utc - 1.hour..).count >= current_user.max_messages_per_hour
       flash.now[:error] = t ".limit_exceeded"
       render :action => "new"
     elsif @message.save
@@ -127,7 +127,7 @@ class MessagesController < ApplicationController
     @message.message_read = message_read
     if @message.save
       flash[:notice] = notice
-      redirect_back_or_to inbox_messages_path, :status => :see_other
+      redirect_to inbox_messages_path, :status => :see_other
     end
   rescue ActiveRecord::RecordNotFound
     @title = t "messages.no_such_message.title"