Destroy user_attributes and attribute_values when a user is destroyed
This commit is contained in:
1 parent
83bbd77d96
commit
43d87ecf98
3 files changed
+7
-2
No files matched your search
@@ -65,6 +65,10 @@ class Panel::UsersController < ApplicationController
|
||||
else
|
||||
@user = User.find(params[:id])
|
||||
@user.destroy
|
||||
@user.user_attributes.each do |ua|
|
||||
ua.attribute_values.each(&:destroy)
|
||||
ua.destroy
|
||||
end
|
||||
end
|
||||
|
||||
redirect_to :action => :index
|
||||
|
||||
Reference in new issue
Block a user