User's blocked field refactored to use state machine

This commit is contained in:
Andrew8xx8 2013-03-04 18:52:30 +04:00
parent 9a06dd4aa1
commit 0d9a6fe7b1
12 changed files with 40 additions and 33 deletions

View file

@ -45,7 +45,7 @@ class Admin::UsersController < Admin::ApplicationController
end
def unblock
if admin_user.update_attribute(:blocked, false)
if admin_user.activate
redirect_to :back, alert: "Successfully unblocked"
else
redirect_to :back, alert: "Error occured. User was not unblocked"