]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_blocks_controller.rb
Create an empty revoke all blocks page
[rails.git] / app / controllers / user_blocks_controller.rb
index 546c8233c65a4d5f4eeb42d97cc76dc0558c1d28..bf61f906b30de4f9a640d8bb18cae40b12ea1d3b 100644 (file)
@@ -39,11 +39,13 @@ class UserBlocksController < ApplicationController
 
   def create
     if @valid_params
+      now = Time.now.utc
       @user_block = UserBlock.new(
         :user => @user,
         :creator => current_user,
         :reason => params[:user_block][:reason],
-        :ends_at => Time.now.utc + @block_period.hours,
+        :created_at => now,
+        :ends_at => now + @block_period.hours,
         :needs_view => params[:user_block][:needs_view]
       )
 
@@ -87,6 +89,12 @@ class UserBlocksController < ApplicationController
     end
   end
 
+  ##
+  # revokes all active blocks
+  def revoke_all
+    # TODO revoke
+  end
+
   ##
   # shows a list of all the blocks on the given user
   def blocks_on