destroy votes with their corresponding user
This commit is contained in:
parent
94fe0b204c
commit
7bc64b0740
|
@ -130,6 +130,9 @@ class UsersController < ApplicationController
|
|||
# DELETE /users/1
|
||||
# DELETE /users/1.json
|
||||
def destroy
|
||||
Vote.where(user_id: @user.id).each do |vote|
|
||||
vote.destroy
|
||||
end
|
||||
@user.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to room_users_url(@user.room_id), notice: 'User was successfully destroyed.' }
|
||||
|
|
Loading…
Reference in New Issue