-
Notifications
You must be signed in to change notification settings - Fork 4
Add unblock button #299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add unblock button #299
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👏
def block | ||
@user.update_attributes(is_blocked: true) | ||
@coach = Coach.where(user_id: @user.id).first | ||
@coach_applications = CoachApplication.where(coach_id: @coach.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make the changes to the coach applications only for future events? Otherwise we will be changing history.
render template: "sessions/new_coach", status: :unauthorized | ||
elsif params["user_type"] == "admin" | ||
render template: "sessions/new_admin", status: :unauthorized | ||
if @user.present? && @user.is_blocked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice thinking <3
We changed the column/button name from "blacklist" to "block" and added the possibility to unblock coaches. We also created a test.
@simaofreitas : I "fixed" the test by adding a delete button also to the users who are coaches. The test failed because it could find the button.