diff --git a/bin/ci b/bin/ci
new file mode 100755
index 000000000..4137ad5bb
--- /dev/null
+++ b/bin/ci
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+require_relative "../config/boot"
+require "active_support/continuous_integration"
+
+CI = ActiveSupport::ContinuousIntegration
+require_relative "../config/ci.rb"
diff --git a/bin/coverage_badge.rb b/bin/coverage_badge.rb
old mode 100644
new mode 100755
diff --git a/bin/dev b/bin/dev
new file mode 100755
index 000000000..5f91c2054
--- /dev/null
+++ b/bin/dev
@@ -0,0 +1,2 @@
+#!/usr/bin/env ruby
+exec "./bin/rails", "server", *ARGV
diff --git a/bin/rails b/bin/rails
index 073966023..efc037749 100755
--- a/bin/rails
+++ b/bin/rails
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
-APP_PATH = File.expand_path('../config/application', __dir__)
-require_relative '../config/boot'
-require 'rails/commands'
+APP_PATH = File.expand_path("../config/application", __dir__)
+require_relative "../config/boot"
+require "rails/commands"
diff --git a/bin/rake b/bin/rake
index 17240489f..4fbf10b96 100755
--- a/bin/rake
+++ b/bin/rake
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
-require_relative '../config/boot'
-require 'rake'
+require_relative "../config/boot"
+require "rake"
Rake.application.run
diff --git a/bin/setup b/bin/setup
index 114226b79..81be011e8 100755
--- a/bin/setup
+++ b/bin/setup
@@ -1,36 +1,35 @@
#!/usr/bin/env ruby
-require 'fileutils'
+require "fileutils"
-# path to your application root.
-APP_ROOT = File.expand_path('..', __dir__)
+APP_ROOT = File.expand_path("..", __dir__)
def system!(*args)
- system(*args) || abort("\n== Command #{args} failed ==")
+ system(*args, exception: true)
end
FileUtils.chdir APP_ROOT do
- # This script is a way to setup or update your development environment automatically.
- # This script is idempotent, so that you can run it at anytime and get an expectable outcome.
+ # 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 "== Installing dependencies =="
+ system("bundle check") || system!("bundle install")
- # Install JavaScript dependencies
- # system('bin/yarn')
-
- puts "\n== Copying env files =="
- unless File.exist?('.env')
- FileUtils.cp '.env.sample', '.env'
- end
+ # 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'
+ system! "bin/rails db:prepare"
+ system! "bin/rails db:reset" if ARGV.include?("--reset")
puts "\n== Removing old logs and tempfiles =="
- system! 'bin/rails log:clear tmp:clear'
+ system! "bin/rails log:clear tmp:clear"
- puts "\n== Restarting application server =="
- system! 'bin/rails restart'
+ unless ARGV.include?("--skip-server")
+ puts "\n== Starting development server =="
+ STDOUT.flush # flush the output before exec(2) so that it displays
+ exec "bin/dev"
+ end
end
diff --git a/config/application.rb b/config/application.rb
index 271c0421f..6d3c1ce01 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -1,6 +1,6 @@
-require_relative 'boot'
+require_relative "boot"
-require 'rails/all'
+require "rails/all"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
@@ -9,12 +9,19 @@
module Awbw
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
- config.load_defaults 6.1
+ config.load_defaults 8.1
- # Settings in config/environments/* take precedence over those specified here.
- # Application configuration can go into files in config/initializers
- # -- all .rb files in that directory are automatically loaded after loading
- # the framework and any gems in your application.
- config.autoloader = :zeitwerk
+ # 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: %w[assets tasks])
+
+ # Configuration for the application, engines, and railties goes here.
+ #
+ # These settings can be overridden in specific environments using the files
+ # in config/environments, which are processed later.
+ #
+ # config.time_zone = "Central Time (US & Canada)"
+ # config.eager_load_paths << Rails.root.join("extras")
end
end
diff --git a/config/boot.rb b/config/boot.rb
index 2d99227a7..282011619 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -1,4 +1,3 @@
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
-require 'bundler/setup' # Set up gems listed in the Gemfile.
-require 'logger'
+require "bundler/setup" # Set up gems listed in the Gemfile.
diff --git a/config/ci.rb b/config/ci.rb
new file mode 100644
index 000000000..beada9ae6
--- /dev/null
+++ b/config/ci.rb
@@ -0,0 +1,20 @@
+# Run using bin/ci
+
+CI.run do
+ step "Setup", "bin/setup --skip-server"
+
+ step "Security: Gem audit", "bin/bundler-audit"
+ step "Security: Importmap vulnerability audit", "bin/importmap audit"
+
+ step "Tests: Rails", "bin/rails test"
+ step "Tests: System", "bin/rails test:system"
+ step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant"
+
+ # Optional: set a green GitHub commit status to unblock PR merge.
+ # Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`.
+ # if success?
+ # step "Signoff: All systems go. Ready for merge and deploy.", "gh signoff"
+ # else
+ # failure "Signoff: CI failed. Do not merge or deploy.", "Fix the issues and try again."
+ # end
+end
diff --git a/config/secrets.yml b/config/credentials.yml
similarity index 100%
rename from config/secrets.yml
rename to config/credentials.yml
diff --git a/config/environment.rb b/config/environment.rb
index 426333bb4..cac531577 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -1,5 +1,5 @@
# Load the Rails application.
-require_relative 'application'
+require_relative "application"
# Initialize the Rails application.
Rails.application.initialize!
diff --git a/config/environments/development.rb b/config/environments/development.rb
index f2bce49d0..4b9b325ab 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,10 +1,10 @@
+require "active_support/core_ext/integer/time"
+
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 on
- # every request. 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
@@ -12,30 +12,34 @@
# Show full error reports.
config.consider_all_requests_local = true
- # Enable/disable caching. By default caching is disabled.
- # Run rails dev:cache to toggle caching.
- if Rails.root.join('tmp', 'caching-dev.txt').exist?
+ # Enable server timing.
+ config.server_timing = true
+
+ # 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
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = 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
@@ -45,23 +49,25 @@
# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true
- # Debug mode disables concatenation and preprocessing of assets.
- # This option may cause significant delays in view rendering with a large
- # number of complex assets.
- config.assets.debug = 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
config.assets.unknown_asset_fallback = false
# Suppress logger output for asset requests.
config.assets.quiet = true
# Raises error for missing translations.
- # config.action_view.raise_on_missing_translations = true
+ # config.i18n.raise_on_missing_translations = true
+
+ # Annotate rendered view with file names.
+ config.action_view.annotate_rendered_view_with_filenames = true
- # Use an evented file watcher to asynchronously detect changes in source code,
- # routes, locales, etc. This feature depends on the listen gem.
- config.file_watcher = ActiveSupport::EventedFileUpdateChecker
+ # Uncomment if you wish to allow Action Cable access from any origin.
+ # config.action_cable.disable_request_forgery_protection = true
- # needed for codespaces
- config.hosts << ".app.github.dev"
+ # 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/config/environments/production.rb b/config/environments/production.rb
index 1dfe8dc51..ad8a6766b 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -1,19 +1,34 @@
+require "active_support/core_ext/integer/time"
+
Rails.application.configure do
# 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
+ # Full error reports are disabled.
+ config.consider_all_requests_local = false
+
+ # Turn on fragment caching in view templates.
config.action_controller.perform_caching = true
+ # Cache digest stamped assets for far-future expiry.
+ # Short cache for others: robots.txt, sitemap.xml, 404.html, etc.
+ config.public_file_server.headers = {
+ "cache-control" => lambda do |path, _|
+ if path.start_with?("/assets/")
+ # Files in /assets/ are expected to be fully immutable.
+ # If the content change the URL too.
+ "public, immutable, max-age=#{1.year.to_i}"
+ else
+ # For anything else we cache for 1 minute.
+ "public, max-age=#{1.minute.to_i}, stale-while-revalidate=#{5.minutes.to_i}"
+ end
+ end
+ }
# 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
@@ -29,84 +44,71 @@
config.assets.compile = false
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
- # config.action_controller.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
+ # config.asset_host = "http://assets.example.com"
# 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
- # Use the lowest log level to ensure availability of diagnostic information
- # when problems arise.
- config.log_level = :debug
+ # 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")
- # 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 = "awbw_production"
+ # Prevent health checks from clogging up the logs.
+ config.silence_healthcheck_path = "/up"
- config.action_mailer.perform_caching = false
+ # 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
+
+ # 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 bin/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
- # Send deprecation notices to registered listeners.
- config.active_support.deprecation = :notify
-
- # 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
- # Inserts middleware to perform automatic connection switching.
- # The `database_selector` hash is used to pass options to the DatabaseSelector
- # middleware. The `delay` is used to determine how long to wait after a write
- # to send a subsequent read to the primary.
- #
- # The `database_resolver` class is used by the middleware to determine which
- # database is appropriate to use based on the time delay.
- #
- # The `database_resolver_context` class is used by the middleware to set
- # timestamps for the last write to the primary. The resolver uses the context
- # class timestamps to determine how long to wait before reading from the
- # replica.
+ # 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`
+ # ]
#
- # By default Rails will store a last write timestamp in the session. The
- # DatabaseSelector middleware is designed as such you can define your own
- # strategy for connection switching and pass that into the middleware through
- # these configuration options.
- # config.active_record.database_selector = { delay: 2.seconds }
- # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
- # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
+ # Skip DNS rebinding protection for the default health check endpoint.
+ # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
end
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 470dee4be..c2095b117 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -6,26 +6,24 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
- config.cache_classes = true
-
- # Do not eager load code on boot. This avoids loading your whole application
- # just for the purpose of running a single test. If you are using a tool that
- # preloads Rails for running tests, you may have to set it to true.
- config.eager_load = false
-
- # 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}"
- }
-
- # Show full error reports and disable caching.
- config.consider_all_requests_local = true
- config.action_controller.perform_caching = false
+ # While tests run files are not watched, reloading is not necessary.
+ config.enable_reloading = false
+
+ # 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.headers = { "cache-control" => "public, max-age=3600" }
+
+ # 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
@@ -33,16 +31,23 @@
# Store uploaded files on the local file system in a temporary directory.
config.active_storage.service = :test
- config.action_mailer.perform_caching = false
-
# 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
+ # 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.action_view.raise_on_missing_translations = true
+ # 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/config/initializers/active_record_enum_with_rails_admin.rb b/config/initializers/active_record_enum_with_rails_admin.rb
deleted file mode 100644
index 2c270c4a6..000000000
--- a/config/initializers/active_record_enum_with_rails_admin.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-module ActiveRecord
- module RailsAdminEnum
- def enum(definitions)
- super
-
- definitions.each do |name, values|
- define_method("#{ name }_enum") { self.class.send(name.to_s.pluralize).to_a }
-
- define_method("#{ name }=") do |value|
- if value.kind_of?(String) and value.to_i.to_s == value
- super value.to_i
- else
- super value
- end
- end
- end
- end
- end
-end
-
-ActiveRecord::Base.send(:extend, ActiveRecord::RailsAdminEnum)
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
index d5d9f4115..636fadf52 100644
--- a/config/initializers/assets.rb
+++ b/config/initializers/assets.rb
@@ -1,7 +1,7 @@
# Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
-Rails.application.config.assets.version = '1.0'
+Rails.application.config.assets.version = "1.0"
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb
index 35d0f26fc..d51d71397 100644
--- a/config/initializers/content_security_policy.rb
+++ b/config/initializers/content_security_policy.rb
@@ -1,30 +1,29 @@
# Be sure to restart your server when you modify this file.
-# Define an application-wide content security policy
-# For further information see the following documentation
-# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
+# Define an application-wide content security policy.
+# See the Securing Rails Applications Guide for more information:
+# https://guides.rubyonrails.org/security.html#content-security-policy-header
-# Rails.application.config.content_security_policy do |policy|
-# policy.default_src :self, :https
-# policy.font_src :self, :https, :data
-# policy.img_src :self, :https, :data
-# policy.object_src :none
-# policy.script_src :self, :https
-# policy.style_src :self, :https
-# # If you are using webpack-dev-server then specify webpack-dev-server host
-# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
-
-# # Specify URI for violation reports
-# # policy.report_uri "/csp-violation-report-endpoint"
+# Rails.application.configure do
+# config.content_security_policy do |policy|
+# policy.default_src :self, :https
+# policy.font_src :self, :https, :data
+# policy.img_src :self, :https, :data
+# policy.object_src :none
+# policy.script_src :self, :https
+# policy.style_src :self, :https
+# # Specify URI for violation reports
+# # policy.report_uri "/csp-violation-report-endpoint"
+# end
+#
+# # 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 style-src)
+#
+# # Automatically add `nonce` to `javascript_tag`, `javascript_include_tag`, and `stylesheet_link_tag`
+# # if the corresponding directives are specified in `content_security_policy_nonce_directives`.
+# # config.content_security_policy_nonce_auto = true
+#
+# # Report violations without enforcing the policy.
+# # config.content_security_policy_report_only = true
# end
-
-# If you are using UJS then enable automatic nonce generation
-# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
-
-# Set the nonce only to specific directives
-# Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
-
-# Report CSP violations to a specified URI
-# For further information see the following documentation:
-# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
-# Rails.application.config.content_security_policy_report_only = true
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index 6e922e1dc..1308adba3 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -4,7 +4,7 @@
# The secret key used by Devise. Devise uses this key to generate
# random tokens. Changing this key will render invalid all existing
# confirmation, reset password and unlock tokens in the database.
- config.secret_key = Rails.application.secrets.secret_key_base || ENV['SECRET_KEY_BASE']
+ config.secret_key = Rails.application.credentials.secret_key_base || ENV['SECRET_KEY_BASE']
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb
index 4a994e1e7..c0b717f7e 100644
--- a/config/initializers/filter_parameter_logging.rb
+++ b/config/initializers/filter_parameter_logging.rb
@@ -1,4 +1,8 @@
# Be sure to restart your server when you modify this file.
-# Configure sensitive parameters which will be filtered from the log file.
-Rails.application.config.filter_parameters += [:password]
+# 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, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
+]
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
index ac033bf9d..3860f659e 100644
--- a/config/initializers/inflections.rb
+++ b/config/initializers/inflections.rb
@@ -4,13 +4,13 @@
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
-# inflect.plural /^(ox)$/i, '\1en'
-# inflect.singular /^(ox)en/i, '\1'
-# inflect.irregular 'person', 'people'
+# inflect.plural /^(ox)$/i, "\\1en"
+# inflect.singular /^(ox)en/i, "\\1"
+# inflect.irregular "person", "people"
# inflect.uncountable %w( fish sheep )
# end
# These inflection rules are supported but not enabled by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
-# inflect.acronym 'RESTful'
+# inflect.acronym "RESTful"
# end
diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb
new file mode 100644
index 000000000..f0bdead4c
--- /dev/null
+++ b/config/initializers/paperclip.rb
@@ -0,0 +1,3 @@
+Paperclip::Attachment.default_options[:path] = ":rails_root/public:url"
+Paperclip::Attachment.default_options[:url] = "/system/:class/:attachment/:id_partition/:style/:filename"
+Paperclip::Attachment.default_options[:default_url] = "/images/missing.png"
\ No newline at end of file
diff --git a/config/initializers/permissions_policy.rb b/config/initializers/permissions_policy.rb
new file mode 100644
index 000000000..7db3b9577
--- /dev/null
+++ b/config/initializers/permissions_policy.rb
@@ -0,0 +1,13 @@
+# Be sure to restart your server when you modify this file.
+
+# 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 |policy|
+# policy.camera :none
+# policy.gyroscope :none
+# policy.microphone :none
+# policy.usb :none
+# policy.fullscreen :self
+# policy.payment :self, "https://secure.example.com"
+# end
diff --git a/config/puma.rb b/config/puma.rb
index 5ed443774..38c4b8659 100644
--- a/config/puma.rb
+++ b/config/puma.rb
@@ -1,38 +1,42 @@
-# 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.
#
-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 `port` that Puma will listen on to receive requests; default is 3000.
+# Puma starts a configurable number of processes (workers) and each process
+# serves each request in a thread from an internal thread pool.
#
-port ENV.fetch("PORT") { 3000 }
-
-# Specifies the `environment` that Puma will run in.
+# 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. You can set it to `auto` to automatically start a worker
+# for each available processor.
#
-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).
+# 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.
#
-# 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.
+# 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.
#
-# preload_app!
+# The default is set to 3 threads as it's deemed a decent compromise between
+# throughput and latency for the average Rails application.
+#
+# 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 `rails restart` command.
+# Allow puma to be restarted by `bin/rails restart` command.
plugin :tmp_restart
+
+# Run the Solid Queue supervisor inside of Puma for single-server deployments.
+plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
+
+# 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/db/migrate/20250912180651_add_service_name_to_active_storage_blobs.active_storage.rb b/db/migrate/20250912180651_add_service_name_to_active_storage_blobs.active_storage.rb
new file mode 100644
index 000000000..a15c6ce8e
--- /dev/null
+++ b/db/migrate/20250912180651_add_service_name_to_active_storage_blobs.active_storage.rb
@@ -0,0 +1,22 @@
+# This migration comes from active_storage (originally 20190112182829)
+class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
+ def up
+ return unless table_exists?(:active_storage_blobs)
+
+ unless column_exists?(:active_storage_blobs, :service_name)
+ add_column :active_storage_blobs, :service_name, :string
+
+ if configured_service = ActiveStorage::Blob.service.name
+ ActiveStorage::Blob.unscoped.update_all(service_name: configured_service)
+ end
+
+ change_column :active_storage_blobs, :service_name, :string, null: false
+ end
+ end
+
+ def down
+ return unless table_exists?(:active_storage_blobs)
+
+ remove_column :active_storage_blobs, :service_name
+ end
+end
diff --git a/db/migrate/20250912180652_create_active_storage_variant_records.active_storage.rb b/db/migrate/20250912180652_create_active_storage_variant_records.active_storage.rb
new file mode 100644
index 000000000..94ac83af0
--- /dev/null
+++ b/db/migrate/20250912180652_create_active_storage_variant_records.active_storage.rb
@@ -0,0 +1,27 @@
+# This migration comes from active_storage (originally 20191206030411)
+class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
+ def change
+ return unless table_exists?(:active_storage_blobs)
+
+ # Use Active Record's configured type for primary key
+ create_table :active_storage_variant_records, id: primary_key_type, if_not_exists: true do |t|
+ t.belongs_to :blob, null: false, index: false, type: blobs_primary_key_type
+ t.string :variation_digest, null: false
+
+ t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness", unique: true
+ t.foreign_key :active_storage_blobs, column: :blob_id
+ end
+ end
+
+ private
+ def primary_key_type
+ config = Rails.configuration.generators
+ config.options[config.orm][:primary_key_type] || :primary_key
+ end
+
+ def blobs_primary_key_type
+ pkey_name = connection.primary_key(:active_storage_blobs)
+ pkey_column = connection.columns(:active_storage_blobs).find { |c| c.name == pkey_name }
+ pkey_column.bigint? ? :bigint : pkey_column.type
+ end
+end
diff --git a/db/migrate/20250912180653_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb b/db/migrate/20250912180653_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb
new file mode 100644
index 000000000..93c8b85ad
--- /dev/null
+++ b/db/migrate/20250912180653_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb
@@ -0,0 +1,8 @@
+# This migration comes from active_storage (originally 20211119233751)
+class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0]
+ def change
+ return unless table_exists?(:active_storage_blobs)
+
+ change_column_null(:active_storage_blobs, :checksum, true)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 65178cfe6..aca894c58 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -18,23 +18,23 @@
t.string "first_name", default: "", null: false
t.string "last_name", default: "", null: false
t.string "reset_password_token"
- t.datetime "reset_password_sent_at"
- t.datetime "remember_created_at"
+ t.datetime "reset_password_sent_at", precision: nil
+ t.datetime "remember_created_at", precision: nil
t.integer "sign_in_count", default: 0, null: false
- t.datetime "current_sign_in_at"
- t.datetime "last_sign_in_at"
+ t.datetime "current_sign_in_at", precision: nil
+ t.datetime "last_sign_in_at", precision: nil
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", precision: nil
+ t.datetime "updated_at", precision: nil
t.index ["email"], name: "index_admins_on_email", unique: true
t.index ["reset_password_token"], name: "index_admins_on_reset_password_token", unique: true
end
create_table "age_ranges", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "name"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.integer "windows_type_id"
t.index ["windows_type_id"], name: "index_age_ranges_on_windows_type_id"
end
@@ -42,26 +42,26 @@
create_table "answer_options", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "name"
t.integer "order"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
end
create_table "attachments", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.integer "owner_id"
t.string "owner_type"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.string "file_file_name"
t.string "file_content_type"
t.integer "file_file_size"
- t.datetime "file_updated_at"
+ t.datetime "file_updated_at", precision: nil
end
create_table "banners", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.text "content"
t.boolean "show"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
end
create_table "bookmark_annotations", id: :integer, charset: "utf8mb3", force: :cascade do |t|
@@ -76,8 +76,8 @@
t.integer "user_id"
t.string "bookmarkable_type"
t.integer "bookmarkable_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.index ["user_id"], name: "index_bookmarks_on_user_id"
end
@@ -85,8 +85,8 @@
t.integer "metadatum_id"
t.string "name"
t.integer "legacy_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.boolean "published", default: false
t.index ["metadatum_id"], name: "index_categories_on_metadatum_id"
end
@@ -96,8 +96,8 @@
t.string "categorizable_type"
t.integer "category_id"
t.integer "legacy_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.boolean "inactive", default: true
t.index ["category_id"], name: "index_categorizable_items_on_category_id"
end
@@ -111,8 +111,8 @@
t.string "type", limit: 30
t.integer "width"
t.integer "height"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.string "actual_url"
t.index ["assetable_type", "assetable_id"], name: "idx_ckeditor_assetable"
t.index ["assetable_type", "type", "assetable_id"], name: "idx_ckeditor_assetable_type"
@@ -170,8 +170,8 @@
t.string "children_program"
t.string "adult_program"
t.string "general_questions"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
end
create_table "form_builders", id: :integer, charset: "utf8mb3", force: :cascade do |t|
@@ -187,16 +187,16 @@
create_table "form_field_answer_options", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.integer "form_field_id"
t.integer "answer_option_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.index ["answer_option_id"], name: "index_form_field_answer_options_on_answer_option_id"
t.index ["form_field_id"], name: "index_form_field_answer_options_on_form_field_id"
end
create_table "form_fields", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.integer "form_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.string "question"
t.string "instructional_hint"
t.integer "answer_type"
@@ -211,8 +211,8 @@
create_table "forms", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "owner_type"
t.integer "owner_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.integer "form_builder_id"
t.index ["form_builder_id"], name: "index_forms_on_form_builder_id"
end
@@ -220,12 +220,12 @@
create_table "images", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.integer "owner_id"
t.string "owner_type"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.string "file_file_name"
t.string "file_content_type"
t.integer "file_file_size"
- t.datetime "file_updated_at"
+ t.datetime "file_updated_at", precision: nil
t.integer "report_id"
t.index ["owner_id"], name: "index_images_on_owner_id"
end
@@ -234,15 +234,15 @@
t.string "city"
t.string "state"
t.string "country"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
end
create_table "media_files", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "file_file_name"
t.string "file_content_type"
t.integer "file_file_size"
- t.datetime "file_updated_at"
+ t.datetime "file_updated_at", precision: nil
t.integer "report_id"
t.integer "workshop_log_id"
end
@@ -250,8 +250,8 @@
create_table "metadata", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "name"
t.string "legacy_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.boolean "published", default: false
end
@@ -272,8 +272,8 @@
t.boolean "call_requested"
t.string "best_call_time"
t.string "phone"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.index ["project_id"], name: "index_monthly_reports_on_project_id"
t.index ["project_user_id"], name: "index_monthly_reports_on_project_user_id"
end
@@ -288,29 +288,29 @@
create_table "permissions", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "security_cat"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.integer "legacy_id"
end
create_table "project_obligations", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "name"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
end
create_table "project_statuses", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "name"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
end
create_table "project_users", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.integer "agency_id"
t.integer "user_id"
t.integer "position"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.integer "project_id"
t.string "filemaker_code"
t.index ["agency_id"], name: "index_project_users_on_agency_id"
@@ -321,8 +321,8 @@
create_table "projects", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "name"
t.integer "location_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.integer "windows_type_id"
t.string "district"
t.date "start_date"
@@ -345,8 +345,8 @@
t.integer "quotable_id"
t.integer "legacy_id"
t.integer "quote_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.index ["quote_id"], name: "index_quotable_item_quotes_on_quote_id"
end
@@ -355,8 +355,8 @@
t.boolean "inactive", default: true
t.integer "legacy_id"
t.boolean "legacy", default: false
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.integer "workshop_id"
t.string "age"
t.string "gender", limit: 1
@@ -380,8 +380,8 @@
t.string "type"
t.integer "owner_id"
t.string "owner_type"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.integer "user_id"
t.integer "project_id"
t.date "date"
@@ -390,7 +390,7 @@
t.string "form_file_file_name"
t.string "form_file_content_type"
t.integer "form_file_file_size"
- t.datetime "form_file_updated_at"
+ t.datetime "form_file_updated_at", precision: nil
t.integer "workshop_id"
t.string "workshop_name"
t.string "other_description"
@@ -412,8 +412,8 @@
t.integer "user_id"
t.text "text", size: :medium
t.boolean "featured", default: false
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.string "kind"
t.integer "workshop_id"
t.boolean "male", default: false
@@ -435,16 +435,16 @@
t.integer "sectorable_id"
t.string "sectorable_type"
t.integer "sector_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.boolean "inactive", default: true
t.index ["sector_id"], name: "index_sectorable_items_on_sector_id"
end
create_table "sectors", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "name"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.boolean "published", default: false
end
@@ -461,8 +461,8 @@
create_table "user_forms", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.integer "user_id"
t.integer "form_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.index ["form_id"], name: "index_user_forms_on_form_id"
t.index ["user_id"], name: "index_user_forms_on_user_id"
end
@@ -470,8 +470,8 @@
create_table "user_permissions", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.integer "user_id"
t.integer "permission_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.index ["permission_id"], name: "index_user_permissions_on_permission_id"
t.index ["user_id"], name: "index_user_permissions_on_user_id"
end
@@ -482,15 +482,15 @@
t.string "first_name", default: ""
t.string "last_name", default: ""
t.string "reset_password_token"
- t.datetime "reset_password_sent_at"
- t.datetime "remember_created_at"
+ t.datetime "reset_password_sent_at", precision: nil
+ t.datetime "remember_created_at", precision: nil
t.integer "sign_in_count", default: 0, null: false
- t.datetime "current_sign_in_at"
- t.datetime "last_sign_in_at"
+ t.datetime "current_sign_in_at", precision: nil
+ t.datetime "last_sign_in_at", precision: nil
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", precision: nil
+ t.datetime "updated_at", precision: nil
t.integer "agency_id"
t.string "phone"
t.string "address"
@@ -516,7 +516,7 @@
t.string "avatar_file_name"
t.string "avatar_content_type"
t.integer "avatar_file_size"
- t.datetime "avatar_updated_at"
+ t.datetime "avatar_updated_at", precision: nil
t.boolean "super_user", default: false
t.bigint "facilitator_id"
t.index ["agency_id"], name: "index_users_on_agency_id"
@@ -527,8 +527,8 @@
create_table "windows_types", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "name"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.integer "legacy_id"
t.string "short_name"
end
@@ -536,8 +536,8 @@
create_table "workshop_age_ranges", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.integer "workshop_id"
t.integer "age_range_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.index ["age_range_id"], name: "index_workshop_age_ranges_on_age_range_id"
t.index ["workshop_id"], name: "index_workshop_age_ranges_on_workshop_id"
end
@@ -570,8 +570,8 @@
create_table "workshop_resources", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.integer "workshop_id"
t.integer "resource_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.index ["resource_id"], name: "index_workshop_resources_on_resource_id"
t.index ["workshop_id"], name: "index_workshop_resources_on_workshop_id"
end
@@ -618,8 +618,8 @@
t.boolean "featured", default: false
t.string "photo_caption"
t.string "filemaker_code"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", precision: nil, null: false
+ t.datetime "updated_at", precision: nil, null: false
t.boolean "legacy", default: false
t.integer "legacy_id"
t.integer "windows_type_id"
@@ -664,7 +664,7 @@
t.string "header_file_name"
t.string "header_content_type"
t.integer "header_file_size"
- t.datetime "header_updated_at"
+ t.datetime "header_updated_at", precision: nil
t.text "extra_field"
t.text "extra_field_spanish"
t.index ["title", "full_name", "objective", "materials", "introduction", "demonstration", "opening_circle", "warm_up", "creation", "closing", "notes", "tips", "misc1", "misc2"], name: "workshop_fullsearch", type: :fulltext
diff --git a/lib/paperclip_attachment.rb b/lib/paperclip_attachment.rb
deleted file mode 100644
index 5b41d1b72..000000000
--- a/lib/paperclip_attachment.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'paperclip'
-
-module Paperclip
- class Attachment
- alias_method :orig_url, :url
-
- def url(*args)
- unless orig_url(*args).start_with? 'https'
- if orig_url(*args).start_with? 'http'
- orig_url(*args).gsub("http:", "https:")
- else
- orig_url(*args)
- end
- end
-
- end
- end
-end
diff --git a/public/400.html b/public/400.html
new file mode 100644
index 000000000..f59c79ab8
--- /dev/null
+++ b/public/400.html
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+ The server cannot process the request due to a client error (400 Bad Request)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The server cannot process the request due to a client error. Please check the request and try again. If you're the application owner check the logs for more information.
+
+
+
+
+
+
diff --git a/public/404.html b/public/404.html
index b612547fc..26d16027c 100644
--- a/public/404.html
+++ b/public/404.html
@@ -1,67 +1,114 @@
-
-
-
- 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.
-
-
+
+
+
+
+
+
+ The page you were looking for doesn't exist (404 Not found)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved. If you're the application owner check the logs for more information.
+
+
+
+
+
diff --git a/public/406-unsupported-browser.html b/public/406-unsupported-browser.html
new file mode 100644
index 000000000..9532a9ccd
--- /dev/null
+++ b/public/406-unsupported-browser.html
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+ Your browser is not supported (406 Not Acceptable)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Your browser is not supported. Please upgrade your browser to continue.
+
+
+
+
+
+
diff --git a/public/422.html b/public/422.html
index a21f82b3b..ed5a5805d 100644
--- a/public/422.html
+++ b/public/422.html
@@ -1,67 +1,114 @@
-
-
-
- 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.
The change you wanted was rejected. Maybe you tried to change something you didn't have access to. If you're the application owner check the logs for more information.
We're sorry, but something went wrong. If you're the application owner check the logs for more information.
+
+
+
+
+
diff --git a/public/icon.png b/public/icon.png
new file mode 100644
index 000000000..c4c9dbfbb
Binary files /dev/null and b/public/icon.png differ
diff --git a/public/icon.svg b/public/icon.svg
new file mode 100644
index 000000000..04b34bf83
--- /dev/null
+++ b/public/icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/public/images/missing_painting.png b/public/images/missing_painting.png
new file mode 100644
index 000000000..3d201c02e
Binary files /dev/null and b/public/images/missing_painting.png differ
diff --git a/public/robots.txt b/public/robots.txt
index 3c9c7c01f..c19f78ab6 100644
--- a/public/robots.txt
+++ b/public/robots.txt
@@ -1,5 +1 @@
-# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
-#
-# To ban all spiders from the entire site uncomment the next two lines:
-# User-agent: *
-# Disallow: /
+# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
diff --git a/spec/factories/users.rb b/spec/factories/users.rb
index 4df80e350..84433f8ee 100644
--- a/spec/factories/users.rb
+++ b/spec/factories/users.rb
@@ -1,9 +1,11 @@
+# frozen_string_literal: true
+
FactoryBot.define do
factory :user do
first_name { Faker::Name.first_name }
last_name { Faker::Name.last_name }
email { Faker::Internet.unique.email }
- password { 'password' }
- password_confirmation { 'password' }
+ password { "password" }
+ password_confirmation { "password" }
end
-end
\ No newline at end of file
+end
diff --git a/spec/models/notification_spec.rb b/spec/models/notification_spec.rb
index b2e4dd1e5..4184d6395 100644
--- a/spec/models/notification_spec.rb
+++ b/spec/models/notification_spec.rb
@@ -7,6 +7,6 @@
end
describe 'enums' do
- it { should define_enum_for(:notification_type).with_values([:created, :updated]) }
+ it { should define_enum_for(:notification_type).with_values(created: 0, updated: 1) }
end
end
\ No newline at end of file
diff --git a/spec/models/project_user_spec.rb b/spec/models/project_user_spec.rb
index ee9e5d5c5..67cf6e9b0 100644
--- a/spec/models/project_user_spec.rb
+++ b/spec/models/project_user_spec.rb
@@ -18,7 +18,7 @@
end
describe 'enums' do
- it { should define_enum_for(:position).with_values([:default, :liaison, :leader, :assistant]) }
+ it { should define_enum_for(:position).with_values(default: 0, liaison: 1, leader: 2, assistant: 3) }
end
it 'is valid with valid attributes' do
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index 734183c80..50b8fa0d9 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -40,7 +40,7 @@
end
RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
+ config.fixture_paths = ["#{::Rails.root}/spec/fixtures"]
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
diff --git a/spec/requests/event_registrations_spec.rb b/spec/requests/event_registrations_spec.rb
index 74b29cc8d..ca585e691 100644
--- a/spec/requests/event_registrations_spec.rb
+++ b/spec/requests/event_registrations_spec.rb
@@ -297,4 +297,4 @@
end
end
end
-end
\ No newline at end of file
+end