- Dummy
+ <%= content_for(:title) || "Dummy" %>
+
+
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
+ <%= yield :head %>
+
+ <%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
+ <%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
+
+
+
+
+
+ <%# Includes all stylesheet files in app/views/stylesheets %>
<%= stylesheet_link_tag "application" %>
diff --git a/test/dummy/app/views/layouts/mailer.html.erb b/test/dummy/app/views/layouts/mailer.html.erb
index cbd34d2e..3aac9002 100644
--- a/test/dummy/app/views/layouts/mailer.html.erb
+++ b/test/dummy/app/views/layouts/mailer.html.erb
@@ -1,7 +1,7 @@
-
+
diff --git a/test/dummy/bin/rails b/test/dummy/bin/rails
deleted file mode 100755
index 22f2d8de..00000000
--- a/test/dummy/bin/rails
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-APP_PATH = File.expand_path("../config/application", __dir__)
-require_relative "../config/boot"
-require "rails/commands"
diff --git a/test/dummy/bin/rake b/test/dummy/bin/rake
deleted file mode 100755
index e436ea54..00000000
--- a/test/dummy/bin/rake
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-require_relative "../config/boot"
-require "rake"
-Rake.application.run
diff --git a/test/dummy/bin/setup b/test/dummy/bin/setup
deleted file mode 100755
index a131de0c..00000000
--- a/test/dummy/bin/setup
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-require "fileutils"
-
-# path to your application root.
-APP_ROOT = File.expand_path("..", __dir__)
-
-def system!(*args)
- system(*args) || abort("\n== Command #{args} failed ==")
-end
-
-FileUtils.chdir(APP_ROOT) do
- # This script is a way to set up or update your development environment automatically.
- # This script is idempotent, so that you can run it at any time and get an expectable outcome.
- # Add necessary setup steps to this file.
-
- puts "== Installing dependencies =="
- system! "gem install bundler --conservative"
- system("bundle check") || system!("bundle install")
-
- # puts "\n== Copying sample files =="
- # unless File.exist?("config/database.yml")
- # FileUtils.cp "config/database.yml.sample", "config/database.yml"
- # end
-
- puts "\n== Preparing database =="
- system! "bin/rails db:prepare"
-
- puts "\n== Removing old logs and tempfiles =="
- system! "bin/rails log:clear tmp:clear"
-
- puts "\n== Restarting application server =="
- system! "bin/rails restart"
-end
diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb
index a50dff65..9d6ccae4 100644
--- a/test/dummy/config/application.rb
+++ b/test/dummy/config/application.rb
@@ -2,29 +2,25 @@
require_relative "boot"
-require "active_model/railtie"
-require "active_job/railtie"
-require "active_record/railtie"
-# require "active_storage/engine"
-require "action_controller/railtie"
-# require "action_mailer/railtie"
-# require "action_mailbox/engine"
-# require "action_text/engine"
-require "action_view/railtie"
-# require "action_cable/engine"
-require "rails/test_unit/railtie"
+require "rails/all"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
-require "ruby-lsp-rails"
module Dummy
class Application < Rails::Application
+ # Normally this is disabled for the test environment (see `actionpack/lib/action_dispatch/railtie.rb`)
+ initializer "enable_route_source_locations", after: "action_dispatch.configure" do |_app|
+ ActionDispatch::Routing::Mapper.route_source_locations = true
+ end
+
config.load_defaults(Rails::VERSION::STRING.to_f)
- # For compatibility with applications that use this config
- config.action_controller.include_all_helpers = false
+ # Please, add to the `ignore` list any other `lib` subdirectories that do
+ # not contain `.rb` files, or that should not be reloaded or eager loaded.
+ # Common ones are `templates`, `generators`, or `middleware`, for example.
+ config.autoload_lib(ignore: ["assets", "tasks"])
# Configuration for the application, engines, and railties goes here.
#
@@ -33,8 +29,5 @@ class Application < Rails::Application
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")
-
- # Don't generate system test files.
- config.generators.system_tests = nil
end
end
diff --git a/test/dummy/config/boot.rb b/test/dummy/config/boot.rb
index ee3010b6..91063c1a 100644
--- a/test/dummy/config/boot.rb
+++ b/test/dummy/config/boot.rb
@@ -5,5 +5,3 @@
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
$LOAD_PATH.unshift(File.expand_path("../../../lib", __dir__))
-
-require "sorbet-runtime"
diff --git a/test/dummy/config/database.yml b/test/dummy/config/database.yml
index fcba57f1..01bebb50 100644
--- a/test/dummy/config/database.yml
+++ b/test/dummy/config/database.yml
@@ -11,15 +11,22 @@ default: &default
development:
<<: *default
- database: db/development.sqlite3
+ database: storage/development.sqlite3
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
- database: db/test.sqlite3
+ database: storage/test.sqlite3
+
+# SQLite3 write its data on the local filesystem, as such it requires
+# persistent disks. If you are deploying to a managed service, you should
+# make sure it provides disk persistence, as many don't.
+#
+# Similarly, if you deploy your application as a Docker container, you must
+# ensure the database is located in a persisted volume.
production:
<<: *default
- database: db/production.sqlite3
+ # database: path/to/persistent/storage/production.sqlite3
diff --git a/test/dummy/config/environments/development.rb b/test/dummy/config/environments/development.rb
index 84c12bb4..4fa6c6b3 100644
--- a/test/dummy/config/environments/development.rb
+++ b/test/dummy/config/environments/development.rb
@@ -5,10 +5,8 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
- # In the development environment your application's code is reloaded any time
- # it changes. This slows down response time but is perfect for development
- # since you don't have to restart the web server when you make code changes.
- config.cache_classes = false
+ # Make code changes take effect immediately without server restart.
+ config.enable_reloading = true
# Do not eager load code on boot.
config.eager_load = false
@@ -16,54 +14,58 @@
# Show full error reports.
config.consider_all_requests_local = true
- # Enable server timing
+ # Enable server timing.
config.server_timing = true
- # Enable/disable caching. By default caching is disabled.
- # Run rails dev:cache to toggle caching.
+ # Enable/disable Action Controller caching. By default Action Controller caching is disabled.
+ # Run rails dev:cache to toggle Action Controller caching.
if Rails.root.join("tmp/caching-dev.txt").exist?
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true
-
- config.cache_store = :memory_store
- config.public_file_server.headers = {
- "Cache-Control" => "public, max-age=#{2.days.to_i}",
- }
+ config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
else
config.action_controller.perform_caching = false
-
- config.cache_store = :null_store
end
+ # Change to :null_store to avoid any caching.
+ config.cache_store = :memory_store
+
# Store uploaded files on the local file system (see config/storage.yml for options).
- # config.active_storage.service = :local
+ config.active_storage.service = :local
# Don't care if the mailer can't send.
- # config.action_mailer.raise_delivery_errors = false
+ config.action_mailer.raise_delivery_errors = false
- # config.action_mailer.perform_caching = false
+ # Make template changes take effect immediately.
+ config.action_mailer.perform_caching = false
+
+ # Set localhost to be used by links generated in mailer templates.
+ config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
- # Raise exceptions for disallowed deprecations.
- config.active_support.disallowed_deprecation = :raise
-
- # Tell Active Support which deprecation messages to disallow.
- config.active_support.disallowed_deprecation_warnings = []
-
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true
+ # Append comments with runtime information tags to SQL queries in logs.
+ config.active_record.query_log_tags_enabled = true
+
+ # Highlight code that enqueued background job in logs.
+ config.active_job.verbose_enqueue_logs = true
+
# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true
# Annotate rendered view with file names.
- # config.action_view.annotate_rendered_view_with_filenames = true
+ config.action_view.annotate_rendered_view_with_filenames = true
# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true
+
+ # Raise error when a before_action's only/except options reference missing actions.
+ config.action_controller.raise_on_missing_callback_actions = true
end
diff --git a/test/dummy/config/environments/production.rb b/test/dummy/config/environments/production.rb
index 48580073..38d2d68d 100644
--- a/test/dummy/config/environments/production.rb
+++ b/test/dummy/config/environments/production.rb
@@ -6,84 +6,86 @@
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
- config.cache_classes = true
+ config.enable_reloading = false
- # Eager load code on boot. This eager loads most of Rails and
- # your application in memory, allowing both threaded web servers
- # and those relying on copy on write to perform better.
- # Rake tasks automatically ignore this option for performance.
+ # Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
config.eager_load = true
- # Full error reports are disabled and caching is turned on.
- config.consider_all_requests_local = false
- config.action_controller.perform_caching = true
+ # Full error reports are disabled.
+ config.consider_all_requests_local = false
- # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
- # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
- # config.require_master_key = true
+ # Turn on fragment caching in view templates.
+ config.action_controller.perform_caching = true
- # Disable serving static files from the `/public` folder by default since
- # Apache or NGINX already handles this.
- config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
+ # Cache assets for far-future expiry since they are all digest stamped.
+ config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.asset_host = "http://assets.example.com"
- # Specifies the header that your server uses for sending files.
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
- # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
-
# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local
- # Mount Action Cable outside main process or domain.
- # config.action_cable.mount_path = nil
- # config.action_cable.url = "wss://example.com/cable"
- # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
+ # Assume all access to the app is happening through a SSL-terminating reverse proxy.
+ config.assume_ssl = true
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
- # config.force_ssl = true
+ config.force_ssl = true
- # Include generic and useful information about system operation, but avoid logging too much
- # information to avoid inadvertent exposure of personally identifiable information (PII).
- config.log_level = :info
+ # Skip http-to-https redirect for the default health check endpoint.
+ # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
- # Prepend all log lines with the following tags.
+ # Log to STDOUT with the current request id as a default log tag.
config.log_tags = [:request_id]
+ config.logger = ActiveSupport::TaggedLogging.logger($stdout)
- # Use a different cache store in production.
- # config.cache_store = :mem_cache_store
+ # Change to "debug" to log everything (including potentially personally-identifiable information!)
+ config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
+
+ # Prevent health checks from clogging up the logs.
+ config.silence_healthcheck_path = "/up"
- # Use a real queuing backend for Active Job (and separate queues per environment).
- # config.active_job.queue_adapter = :resque
- # config.active_job.queue_name_prefix = "dummy_production"
+ # Don't log any deprecations.
+ config.active_support.report_deprecations = false
+
+ # Replace the default in-process memory cache store with a durable alternative.
+ # config.cache_store = :mem_cache_store
- config.action_mailer.perform_caching = false
+ # Replace the default in-process and non-durable queuing backend for Active Job.
+ # config.active_job.queue_adapter = :resque
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
+ # Set host to be used by links generated in mailer templates.
+ config.action_mailer.default_url_options = { host: "example.com" }
+
+ # Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
+ # config.action_mailer.smtp_settings = {
+ # user_name: Rails.application.credentials.dig(:smtp, :user_name),
+ # password: Rails.application.credentials.dig(:smtp, :password),
+ # address: "smtp.example.com",
+ # port: 587,
+ # authentication: :plain
+ # }
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
- # Don't log any deprecations.
- config.active_support.report_deprecations = false
-
- # Use default logging formatter so that PID and timestamp are not suppressed.
- config.log_formatter = Logger::Formatter.new
-
- # Use a different logger for distributed setups.
- # require "syslog/logger"
- # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
-
- if ENV["RAILS_LOG_TO_STDOUT"].present?
- logger = ActiveSupport::Logger.new($stdout)
- logger.formatter = config.log_formatter
- config.logger = ActiveSupport::TaggedLogging.new(logger)
- end
-
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
+
+ # Only use :id for inspections in production.
+ config.active_record.attributes_for_inspect = [:id]
+
+ # Enable DNS rebinding protection and other `Host` header attacks.
+ # config.hosts = [
+ # "example.com", # Allow requests from example.com
+ # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
+ # ]
+ #
+ # Skip DNS rebinding protection for the default health check endpoint.
+ # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
end
diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb
index 15226965..3b04bf52 100644
--- a/test/dummy/config/environments/test.rb
+++ b/test/dummy/config/environments/test.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "active_support/core_ext/integer/time"
-
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
@@ -10,43 +8,48 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
- # Turn false under Spring and add config.action_view.cache_template_loading = true.
- config.cache_classes = true
+ # While tests run files are not watched, reloading is not necessary.
+ config.enable_reloading = false
- # Eager loading loads your whole application. When running a single test locally,
- # this probably isn't necessary. It's a good idea to do in a continuous integration
- # system, or in some way before deploying your code.
- config.eager_load = true
+ # Eager loading loads your entire application. When running a single test locally,
+ # this is usually not necessary, and can slow down your test suite. However, it's
+ # recommended that you enable it in continuous integration systems to ensure eager
+ # loading is working properly before deploying your code.
+ config.eager_load = ENV["CI"].present?
- # Configure public file server for tests with Cache-Control for performance.
- config.public_file_server.enabled = true
- config.public_file_server.headers = {
- "Cache-Control" => "public, max-age=#{1.hour.to_i}",
- }
+ # Configure public file server for tests with cache-control for performance.
+ config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
- # Show full error reports and disable caching.
- config.consider_all_requests_local = true
- config.action_controller.perform_caching = false
+ # Show full error reports.
+ config.consider_all_requests_local = true
config.cache_store = :null_store
- # Raise exceptions instead of rendering exception templates.
- config.action_dispatch.show_exceptions = false
+ # Render exception templates for rescuable exceptions and raise for other exceptions.
+ config.action_dispatch.show_exceptions = :rescuable
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
- # Print deprecation notices to the stderr.
- config.active_support.deprecation = :stderr
+ # Store uploaded files on the local file system in a temporary directory.
+ config.active_storage.service = :test
- # Raise exceptions for disallowed deprecations.
- config.active_support.disallowed_deprecation = :raise
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
- # Tell Active Support which deprecation messages to disallow.
- config.active_support.disallowed_deprecation_warnings = []
+ # Set host to be used by links generated in mailer templates.
+ config.action_mailer.default_url_options = { host: "example.com" }
+
+ # Print deprecation notices to the stderr.
+ config.active_support.deprecation = :stderr
# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true
+
+ # Raise error when a before_action's only/except options reference missing actions.
+ config.action_controller.raise_on_missing_callback_actions = true
end
diff --git a/test/dummy/config/initializers/content_security_policy.rb b/test/dummy/config/initializers/content_security_policy.rb
index 53538c14..35ab3fd6 100644
--- a/test/dummy/config/initializers/content_security_policy.rb
+++ b/test/dummy/config/initializers/content_security_policy.rb
@@ -18,9 +18,9 @@
# # policy.report_uri "/csp-violation-report-endpoint"
# end
#
-# # Generate session nonces for permitted importmap and inline scripts
+# # Generate session nonces for permitted importmap, inline scripts, and inline styles.
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
-# config.content_security_policy_nonce_directives = %w(script-src)
+# config.content_security_policy_nonce_directives = %w(script-src style-src)
#
# # Report violations without enforcing the policy.
# # config.content_security_policy_report_only = true
diff --git a/test/dummy/config/initializers/filter_parameter_logging.rb b/test/dummy/config/initializers/filter_parameter_logging.rb
index 615869a8..7806a407 100644
--- a/test/dummy/config/initializers/filter_parameter_logging.rb
+++ b/test/dummy/config/initializers/filter_parameter_logging.rb
@@ -2,9 +2,9 @@
# Be sure to restart your server when you modify this file.
-# Configure parameters to be filtered from the log file. Use this to limit dissemination of
-# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
-# notations and behaviors.
+# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
+# Use this to limit dissemination of sensitive information.
+# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
Rails.application.config.filter_parameters += [
- :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn,
+ :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc,
]
diff --git a/test/dummy/config/initializers/permissions_policy.rb b/test/dummy/config/initializers/permissions_policy.rb
deleted file mode 100644
index 810aadeb..00000000
--- a/test/dummy/config/initializers/permissions_policy.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-# Define an application-wide HTTP permissions policy. For further
-# information see https://developers.google.com/web/updates/2018/06/feature-policy
-#
-# Rails.application.config.permissions_policy do |f|
-# f.camera :none
-# f.gyroscope :none
-# f.microphone :none
-# f.usb :none
-# f.fullscreen :self
-# f.payment :self, "https://secure.example.com"
-# end
diff --git a/test/dummy/config/locales/en.yml b/test/dummy/config/locales/en.yml
index 8ca56fc7..6c349ae5 100644
--- a/test/dummy/config/locales/en.yml
+++ b/test/dummy/config/locales/en.yml
@@ -1,6 +1,6 @@
-# Files in the config/locales directory are used for internationalization
-# and are automatically loaded by Rails. If you want to use locales other
-# than English, add the necessary files in this directory.
+# Files in the config/locales directory are used for internationalization and
+# are automatically loaded by Rails. If you want to use locales other than
+# English, add the necessary files in this directory.
#
# To use the locales, use `I18n.t`:
#
@@ -16,18 +16,16 @@
#
# This would use the information in config/locales/es.yml.
#
-# The following keys must be escaped otherwise they will not be retrieved by
-# the default I18n backend:
+# To learn more about the API, please read the Rails Internationalization guide
+# at https://guides.rubyonrails.org/i18n.html.
#
-# true, false, on, off, yes, no
+# Be aware that YAML interprets the following case-insensitive strings as
+# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
+# must be quoted to be interpreted as strings. For example:
#
-# Instead, surround them with single quotes.
-#
-# en:
-# "true": "foo"
-#
-# To learn more, please read the Rails Internationalization guide
-# available at https://guides.rubyonrails.org/i18n.html.
+# en:
+# "yes": yup
+# enabled: "ON"
en:
hello: "Hello world"
diff --git a/test/dummy/config/puma.rb b/test/dummy/config/puma.rb
index 1b1501de..072ed49c 100644
--- a/test/dummy/config/puma.rb
+++ b/test/dummy/config/puma.rb
@@ -1,48 +1,40 @@
# frozen_string_literal: true
-# Puma can serve each request in a thread from an internal thread pool.
-# The `threads` method setting takes two numbers: a minimum and maximum.
-# Any libraries that use thread pools should be configured to match
-# the maximum value specified for Puma. Default is set to 5 threads for minimum
-# and maximum; this matches the default thread size of Active Record.
+# This configuration file will be evaluated by Puma. The top-level methods that
+# are invoked here are part of Puma's configuration DSL. For more information
+# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
#
-
-T.bind(self, Puma::DSL)
-
-max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
-min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
-threads min_threads_count, max_threads_count
-
-# Specifies the `worker_timeout` threshold that Puma will use to wait before
-# terminating a worker in development environments.
+# Puma starts a configurable number of processes (workers) and each process
+# serves each request in a thread from an internal thread pool.
#
-worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
-
-# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
+# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You
+# should only set this value when you want to run 2 or more workers. The
+# default is already 1.
#
-port ENV.fetch("PORT") { 3000 }
-
-# Specifies the `environment` that Puma will run in.
+# The ideal number of threads per worker depends both on how much time the
+# application spends waiting for IO operations and on how much you wish to
+# prioritize throughput over latency.
#
-environment ENV.fetch("RAILS_ENV") { "development" }
-
-# Specifies the `pidfile` that Puma will use.
-pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
-
-# Specifies the number of `workers` to boot in clustered mode.
-# Workers are forked web server processes. If using threads and workers together
-# the concurrency of the application would be max `threads` * `workers`.
-# Workers do not work on JRuby or Windows (both of which do not support
-# processes).
+# As a rule of thumb, increasing the number of threads will increase how much
+# traffic a given process can handle (throughput), but due to CRuby's
+# Global VM Lock (GVL) it has diminishing returns and will degrade the
+# response time (latency) of the application.
#
-# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
-
-# Use the `preload_app!` method when specifying a `workers` number.
-# This directive tells Puma to first boot the application and load code
-# before forking the application. This takes advantage of Copy On Write
-# process behavior so workers use less memory.
+# The default is set to 3 threads as it's deemed a decent compromise between
+# throughput and latency for the average Rails application.
#
-# preload_app!
+# Any libraries that use a connection pool or another resource pool should
+# be configured to provide at least as many connections as the number of
+# threads. This includes Active Record's `pool` parameter in `database.yml`.
+threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
+threads threads_count, threads_count
+
+# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
+port ENV.fetch("PORT", 3000)
# Allow puma to be restarted by `bin/rails restart` command.
plugin :tmp_restart
+
+# Specify the PID file. Defaults to tmp/pids/server.pid in development.
+# In other environments, only set the PID file if requested.
+pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
diff --git a/test/dummy/config/routes.rb b/test/dummy/config/routes.rb
index 268b29a0..0693d974 100644
--- a/test/dummy/config/routes.rb
+++ b/test/dummy/config/routes.rb
@@ -1,7 +1,19 @@
# frozen_string_literal: true
Rails.application.routes.draw do
+ # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
resources :users do
get :archive, on: :collection
end
+
+ # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
+ # Can be used by load balancers and uptime monitors to verify that the app is live.
+ get "up" => "rails/health#show", as: :rails_health_check
+
+ # Render dynamic PWA files from app/views/pwa/* (remember to link manifest in application.html.erb)
+ # get "manifest" => "rails/pwa#manifest", as: :pwa_manifest
+ # get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker
+
+ # Defines the root path route ("/")
+ # root "posts#index"
end
diff --git a/test/dummy/db/schema.rb b/test/dummy/db/schema.rb
index d15d6c1f..fa61c344 100644
--- a/test/dummy/db/schema.rb
+++ b/test/dummy/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[7.1].define(version: 2024_10_25_225348) do
+ActiveRecord::Schema[8.0].define(version: 2024_10_25_225348) do
create_table "composite_primary_keys", primary_key: ["order_id", "product_id"], force: :cascade do |t|
t.integer "order_id"
t.integer "product_id"
diff --git a/test/dummy/lib/assets/.keep b/test/dummy/lib/assets/.keep
deleted file mode 100644
index e69de29b..00000000
diff --git a/test/dummy/public/404.html b/test/dummy/public/404.html
deleted file mode 100644
index 2be3af26..00000000
--- a/test/dummy/public/404.html
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
- The page you were looking for doesn't exist (404)
-
-
-
-
-
-
-
-
-
The page you were looking for doesn't exist.
-
You may have mistyped the address or the page may have moved.
-
-
If you are the application owner check the logs for more information.
-
-
-
diff --git a/test/dummy/public/422.html b/test/dummy/public/422.html
deleted file mode 100644
index c08eac0d..00000000
--- a/test/dummy/public/422.html
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
- The change you wanted was rejected (422)
-
-
-
-
-
-
-
-
-
The change you wanted was rejected.
-
Maybe you tried to change something you didn't have access to.
-
-
If you are the application owner check the logs for more information.