- if params[:confirm]
- if @user_block.revoke! current_user
- flash[:notice] = t ".flash"
- redirect_to(@user_block)
- end
+ if request.post? && params[:confirm] && @user_block.revoke!(current_user)
+ flash[:notice] = t ".flash"
+ redirect_to(@user_block)
+ end
+ end
+
+ ##
+ # revokes all active blocks
+ def revoke_all
+ if request.post? && params[:confirm]
+ @user.blocks.active.each { |block| block.revoke!(current_user) }
+ flash[:notice] = t ".flash"
+ redirect_to user_blocks_on_path(@user)