Skip to content

Commit defc76e

Browse files
authored
Merge pull request #1111 from turger/add-admin-instructions
Add instructions for adding yourself as an admin locally
2 parents 4f5cd2d + 3024155 commit defc76e

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ Syntax guidelines:
4444
* `my_method(my_arg)` or `my_method` and _not_ `my_method( my_arg )`
4545
* `a = b` and not `a=b`.
4646
* Aim for 1.9 hash syntax - `{ dog: "Akira", cat: "Rocky" }` rather than `{ :dog => "Akira", :pug => "Rocky" }`
47-
* Follow the conventions you see used in the source already.
47+
* Follow the conventions you see used in the source already.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ This should run a process which starts a server in a Docker container on your co
114114
Rails 4.2.11 application starting in development on http://0.0.0.0:3000
115115
```
116116

117+
(Optional) Note that to be able to use the page as an admin, you must first give yourself admin privileges. Make sure you have started your app and signed up as an user on your locally running app. Then run a script `bin/dadmin <your email>`.
118+
117119
**You can now view the app at http://localhost:3000**
118120

119121
You can stop the server when you're finished by typing `Ctrl + C`.

bin/dadmin

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
set -e
3+
4+
if [ $# -gt 0 ]
5+
then
6+
docker-compose run --rm web rails runner "Member.find_by(email: '$@').add_role(:admin)"
7+
else
8+
docker-compose run --rm web rails runner "Member.last.add_role(:admin)"
9+
fi

native-installation-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ These are the original instructions for natively installing the app to your mach
1212
- Generate sample data
1313
4. [Run the app](#run-the-app)
1414
5. [Run the tests](#run-the-tests)
15+
6. (Optional) Note that to be able to use the page as an admin, you must first give yourself admin privileges. Make sure you have started your app and signed up as an user on your locally running app. Then run this on command line: `rails runner "Member.find_by(email: '<your email>').add_role(:admin)"`.
1516

1617
## Set up a Ruby Environment
1718

0 commit comments

Comments
 (0)