Skip to content

Latest commit

 

History

History
177 lines (116 loc) · 6.32 KB

File metadata and controls

177 lines (116 loc) · 6.32 KB

Features

Local Development

Strong Migrations

Uses Strong Migrations to catch unsafe migrations in development.

Seed Data

Follows our guidance for managing seed data. Use db/seeds.rb for data required in all environments, and development:db:seed for data specific to development environments.

Place idempotent seed data in Development::Seeder.

To load development seed data:

bin/rails development:db:seed

To reset your database and reload seed data:

bin/rails development:db:seed:replant

The replant command truncates all tables and reloads the seed data, providing a clean slate for development.

Environment Variables

The following environment variables are available in production:

  • APPLICATION_HOST - The domain where your application is hosted (required)
  • ASSET_HOST - CDN or asset host URL (optional)
  • RAILS_MASTER_KEY - Used for decrypting credentials (required)

Configuration

All Environments

Test

Development

Production

Testing

Uses RSpec and RSpec Rails in favor of the default test suite.

The test suite can be run with bin/rails spec.

Configuration can be found in the following files:

spec/rails_helper.rb
spec/spec_helper.rb
spec/support/action_mailer.rb
spec/support/driver.rb
spec/support/i18n.rb
spec/support/shoulda_matchers.rb

Factories

Uses FactoryBot as an alternative to Fixtures to help you define dummy and test data for your test suite. The create, build, and build_stubbed class methods are directly available to all tests.

Place FactoryBot definitions in spec/factories.rb, at least until it grows unwieldy. This helps reduce confusion around circular dependencies and makes it easy to jump between definitions.

Accessibility

Uses capybara_accessibility_audit and capybara_accessible_selectors to encourage and enforce accessibility best practices.

Mailers

Intercept emails in non-production environments by setting INTERCEPTOR_ADDRESSES.

INTERCEPTOR_ADDRESSES="user_1@example.com,user_2@example.com" bin/rails s

Configuration can be found at config/initializers/email_interceptor.rb.

Interceptor can be found at lib/email_interceptor.rb.

Jobs

Uses Sidekiq for background job processing.

Configures the test environment to use the inline adapter.

Layout and Assets

Inline SVG

Uses inline_svg for embedding SVG documents into views.

Configuration can be found at config/initializers/inline_svg.rb

Layout

  • A partial for flash messages is located in app/views/application/_flashes.html.erb.
  • A partial for form errors is located in app/views/application/_form_errors.html.erb.
  • Sets lang attribute on <html> element to en via I18n.local.
  • Disables Turbo's Prefetch in an effort to reduce unnecessary network requests.