@@ -53,12 +53,11 class RolesController < ApplicationController | |||
|
53 | 53 | |
|
54 | 54 | def destroy |
|
55 | 55 | @role = Role.find(params[:id]) |
|
56 | #unless @role.members.empty? | |
|
57 | # flash[:error] = 'Some members have this role. Can\'t delete it.' | |
|
58 | #else | |
|
59 | @role.destroy | |
|
60 | #end | |
|
56 | @role.destroy | |
|
61 | 57 | redirect_to :action => 'list' |
|
58 | rescue | |
|
59 | flash[:error] = 'This role is in use and can not be deleted.' | |
|
60 | redirect_to :action => 'index' | |
|
62 | 61 | end |
|
63 | 62 | |
|
64 | 63 | def move |
General Comments 0
You need to be logged in to leave comments.
Login now