Advertisement
Guest User

Untitled

a guest
Jan 8th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. def set_user_admin
  2. if admin_true? == true
  3. user = User.find(params[:format])
  4. if user == nil
  5. redirect_to managements_path
  6. else
  7. user.update_attributes(admin: true, assistant: true,
  8. businessman: true)
  9. redirect_to managements_path
  10. flash[:notice] = "The user #{user.name} is an admin user now"
  11. end
  12. else
  13. end
  14. end
  15.  
  16. u = User.find_by_id(3)
  17. u.update_attributes(admin: true)
  18. (0.1ms) rollback transaction
  19. => false
  20. u.errors
  21. @messages={:password=>["Choose a password", "Your password must be at least 4 characters
  22. "], :password_confirmation=>["You must confirm your password
  23. "]}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement