]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_blocks_controller.rb
Don't map multiple paths in a single route
[rails.git] / app / controllers / user_blocks_controller.rb
index c42c2659db0b09aae46b17430b3cac0e25283790..551371794240836b53110059bd945b979c9cc287 100644 (file)
@@ -29,7 +29,7 @@ class UserBlocksController < ApplicationController
   end
 
   def show
-    if current_user && current_user == @user_block.user
+    if current_user && current_user == @user_block.user && !@user_block.deactivates_at
       @user_block.needs_view = false
       @user_block.deactivates_at = [@user_block.ends_at, Time.now.utc].max
       @user_block.save!
@@ -64,7 +64,7 @@ class UserBlocksController < ApplicationController
         render :action => "new"
       end
     else
-      redirect_to new_user_block_path(:display_name => params[:display_name])
+      redirect_to new_user_block_path(params[:display_name])
     end
   end
 
@@ -101,7 +101,7 @@ class UserBlocksController < ApplicationController
         end
       end
     else
-      redirect_to edit_user_block_path(:id => params[:id])
+      redirect_to edit_user_block_path(params[:id])
     end
   end