Make second user admin
This commit is contained in:
parent
4df9fa0fdb
commit
2e7169ede7
1 changed files with 1 additions and 2 deletions
|
|
@ -114,8 +114,7 @@ class User < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def setup_role
|
def setup_role
|
||||||
self.is_admin = true if User.count == 0
|
self.is_admin = true if User.count == 1
|
||||||
roles << Role.where(name: 'Admin') if User.count == 1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Gets the roles of the user, groups them by role.name and returns the resource(s) of each role
|
# Gets the roles of the user, groups them by role.name and returns the resource(s) of each role
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue