Merge pull request #61 from gopesht/fix_first_admin_setup
Fix admin first setup, email and password in README
This commit is contained in:
commit
5ed51c7499
2 changed files with 8 additions and 8 deletions
10
README.md
10
README.md
|
|
@ -77,13 +77,9 @@ bundle exec rake db:seed
|
|||
|
||||
7. Connect to osem.example.org and register your first user. Make also sure that Postfix is installed and configured on the system for the confirmation mail to pass through.
|
||||
|
||||
8. To make the first registered user an admin:
|
||||
```
|
||||
rails console
|
||||
User.all
|
||||
me = User.find('1')
|
||||
me.role_ids=[3]
|
||||
```
|
||||
8. Just sign up as a new user and you will be automatically assigned as admin role.
|
||||
|
||||
|
||||
|
||||
Caveats
|
||||
=======
|
||||
|
|
|
|||
|
|
@ -27,9 +27,13 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def setup_role
|
||||
if self.id == 1
|
||||
self.role_ids = [3]
|
||||
end
|
||||
|
||||
if self.role_ids.empty?
|
||||
self.role_ids = [1]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def popup_details
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue