Skip to content

Helpful Commands

Shen Yang edited this page May 21, 2022 · 50 revisions

Terminal Commands

open the rails console

  rails c
rails s start the app locally
rails routes list all website routes
rake after_party:run run afterparty tasks
rake db:reset reset your test data
yarn test lint javascript and run jest
heroku run rails c --app casa-production Open the rails console in the production environment(requires heroku access)
heroku run "DISABLE_DATABASE_ENVIRONMENT_CHECK=1 rails db:seed:replant --trace" --app casa-qa Truncate the QA database and reseed(requires heroku access)
heroku run "DISABLE_DATABASE_ENVIRONMENT_CHECK=1 rails db:seed:replant --trace" --app casa-r4g-staging Truncate the Staging database and reseed(requires heroku access)
bundle exec rpsec <PATH> run all tests in a file or all tests in a directory

run cypress tests
bundle exec rails server -b 0.0.0.0 -p 4040
npm run test:cypress --exit-code 0

Rails Console Commands

Send a supervisor weekly digest email(opens in new tab)

  SupervisorMailer.weekly_digest(Supervisor.first).deliver_now

Delete all active storage attachments

  ActiveStorage::Attachment.all.each { |attachment| attachment.purge }

Set the court report template for a casa_org

  casa_org.court_report_template.attach(io: File.new(PATH TO DOCUMENT), filename: "document.docx")

Features

Additional Expenses

  FeatureFlagService.enable!("show_additional_expenses") enable
  FeatureFlag.upsert({name: "show_additional_expenses", enabled: "false"}, unique_by: :name) disable

URLs

http://localhost:3000/rails/mailers An index of examples of every type of email

Clone this wiki locally