Seeding the database create an admin user (see Database) with the following credentials:
email: admin@forem.local
password: password
Once logged in as this admin user, you can turn on any authentication methods you'd like (see Authentication)
1 2
cd docs make ruby-doc
Then open .static/ruby-doc/index.html
in the docs
directory and browse the Ruby documentation
By default Rails logs to log.development.log
.
If, instead, you wish to log to STDOUT
you can add the variable:
1
export RAILS_LOG_TO_STDOUT=true
to your own .env
file.
On the home Feed, we only show comments above certain "score". It's likely the comments in the local environment will never meet this score. If you want to see comments locally, you will need to update the score of your local comments manually. Here's how:
rails dbconsole
to open the PostgreSQL terminal. Alternatively, run psql PracticalDeveloper_development
to open psql
, the PostgreSQL terminal.update comments set score = 30;
.exit
to leave the PostgreSQL terminal.Note: dbconsole reads database information from config/database.yml which is always better since database configs might change in the future.
Once you refresh the app, you should be able to see some comments in the Feed.
In certain cases, for example when testing various functionalities, you may need to be able to make some user follow you. Here's how:
rails c
in your terminal.user = User.first
.user.follow(your_username)
.Boom, you have a new follower!
rails c
in your terminal.ruby user = User.find_by(username: "your_username") organization_id = Organization.find_by(slug: "organization_slug").id user.organization_memberships.where(organization_id: organization_id).destroy_all
If you ever want to add Listings locally, you must have credits on your account to "pay" for listing. Here's how:
rails console
.Enter the following commands:
1 2
user = User.find_by(username: "your_username") Credit.add_to(user, 1000)
^ This will add 1000 credits to your account. But you know, you can't really buy anything with it :D