make second user admin

This commit is contained in:
Stella Rouzi 2014-08-17 20:42:34 +03:00
parent 4304072b2c
commit 95b1be7886

View file

@ -49,8 +49,7 @@ class User < ActiveRecord::Base
end
def setup_role
self.is_admin = true if User.count == 0
roles << Role.where(name: 'Admin') if User.count == 1
self.is_admin = true if User.count == 1
end
# Gets the roles of the user, groups them by role.name and returns the resource(s) of each role