Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def set_user_admin
- if admin_true? == true
- user = User.find(params[:format])
- if user == nil
- redirect_to managements_path
- else
- user.update_attributes(admin: true, assistant: true,
- businessman: true)
- redirect_to managements_path
- flash[:notice] = "The user #{user.name} is an admin user now"
- end
- else
- end
- end
- u = User.find_by_id(3)
- u.update_attributes(admin: true)
- (0.1ms) rollback transaction
- => false
- u.errors
- @messages={:password=>["Choose a password", "Your password must be at least 4 characters
- "], :password_confirmation=>["You must confirm your password
- "]}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement