add is_admin attribute to users
This commit is contained in:
parent
07877f3256
commit
0418924d8e
7 changed files with 25 additions and 21 deletions
|
|
@ -53,7 +53,7 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def setup_role
|
||||
roles << Role.where(name: 'organizer') if User.count == 0
|
||||
is_admin = true if User.count == 0
|
||||
roles << Role.where(name: 'participant') if roles.empty?
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue