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