]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user_block.rb
Save the user record after changing it
[rails.git] / app / models / user_block.rb
index f8c05c92ca9e9b5b52e509336201f79142e8fc34..7bf8f86b5095dbf4d12697a826d3d6d3a3639203 100644 (file)
@@ -18,9 +18,11 @@ class UserBlock < ActiveRecord::Base
   # revokes the block, allowing the user to use the API again. the argument
   # is the user object who is revoking the ban.
   def revoke!(revoker)
-    update_attributes({ :ends_at => Time.now.getutc(),
-                        :revoker_id => revoker.id,
-                        :needs_view => false })
+    update_attributes({
+      :ends_at => Time.now.getutc(),
+      :revoker_id => revoker.id,
+      :needs_view => false
+    }, :without_protection => true)
   end
 
   private