User's blocked field refactored to use state machine
This commit is contained in:
parent
9a06dd4aa1
commit
0d9a6fe7b1
12 changed files with 40 additions and 33 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue