ddd_domain 1.2.3 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ddd_domain/version.rb +1 -1
  3. data/test/ddd_domain_test.rb +3 -3
  4. data/test/dummy/Rakefile +1 -1
  5. data/test/dummy/app/assets/stylesheets/application.css +1 -15
  6. data/test/dummy/app/channels/application_cable/channel.rb +4 -0
  7. data/test/dummy/app/channels/application_cable/connection.rb +4 -0
  8. data/test/dummy/app/controllers/application_controller.rb +0 -3
  9. data/test/dummy/app/jobs/application_job.rb +7 -0
  10. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  11. data/test/dummy/app/models/application_record.rb +3 -0
  12. data/test/dummy/app/views/layouts/application.html.erb +10 -9
  13. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  14. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  15. data/test/dummy/bin/rails +3 -3
  16. data/test/dummy/bin/rake +2 -2
  17. data/test/dummy/bin/setup +16 -12
  18. data/test/dummy/config/application.rb +12 -16
  19. data/test/dummy/config/boot.rb +3 -3
  20. data/test/dummy/config/cable.yml +10 -0
  21. data/test/dummy/config/database.yml +3 -3
  22. data/test/dummy/config/environment.rb +1 -1
  23. data/test/dummy/config/environments/development.rb +45 -18
  24. data/test/dummy/config/environments/production.rb +38 -30
  25. data/test/dummy/config/environments/test.rb +34 -16
  26. data/test/dummy/config/initializers/content_security_policy.rb +26 -0
  27. data/test/dummy/config/initializers/filter_parameter_logging.rb +6 -2
  28. data/test/dummy/config/initializers/inflections.rb +4 -4
  29. data/test/dummy/config/initializers/permissions_policy.rb +11 -0
  30. data/test/dummy/config/locales/en.yml +13 -3
  31. data/test/dummy/config/puma.rb +43 -0
  32. data/test/dummy/config/routes.rb +3 -53
  33. data/test/dummy/config/storage.yml +34 -0
  34. data/test/dummy/config.ru +3 -1
  35. data/test/dummy/{app/assets/config/manifest.js → db/test.sqlite3} +0 -0
  36. data/test/dummy/log/test.log +6 -0
  37. data/test/dummy/public/404.html +6 -6
  38. data/test/dummy/public/422.html +6 -6
  39. data/test/dummy/public/500.html +6 -6
  40. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  41. data/test/dummy/public/apple-touch-icon.png +0 -0
  42. data/test/dummy/tmp/development_secret.txt +1 -0
  43. data/test/test_helper.rb +4 -10
  44. metadata +56 -44
  45. data/test/dummy/README.rdoc +0 -28
  46. data/test/dummy/app/assets/javascripts/application.js +0 -13
  47. data/test/dummy/bin/bundle +0 -3
  48. data/test/dummy/config/initializers/assets.rb +0 -11
  49. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  50. data/test/dummy/config/initializers/cookies_serializer.rb +0 -3
  51. data/test/dummy/config/initializers/mime_types.rb +0 -4
  52. data/test/dummy/config/initializers/session_store.rb +0 -3
  53. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  54. data/test/dummy/config/secrets.yml +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c7d05f554c1c7e3c55856ca3ff21d0194698baadabc095cc13e3dd35f65dfbb
4
- data.tar.gz: 8877136005498096cdb59cd63ecaa7509da02d388355f2678a4dcd886ff58a4f
3
+ metadata.gz: 0e364b08acdafc7b684679449ba427231bfd36ee517c0b425dd3a38eb5b95a4a
4
+ data.tar.gz: c8303dd7c1e2939f4081861edc72bc8840c2e06f24931ddd8d95f7a90bf99fd2
5
5
  SHA512:
6
- metadata.gz: 7d2b3b4d240f653b19ee84255f5f5f2054594a11554ff3a4605e7cca87048703104762f1c921e7f2c31c3383ede758dbc2741212c50480f881cbd3739967caea
7
- data.tar.gz: 67dfaf30431672a0b069336fd5ddef8c8854742fc07d8b153e42b70e8c375a2d6b11e4253376c2eb2801bd25b46f9ae6734f60dc8f3e7f47422815276ab929c6
6
+ metadata.gz: c9d8440cbb15cc5a2e1a1f9b4e0029fb01d0609a44e9441f82b2cb5d8bcf9479f1de6a2b8555bc4e858c289900aa5cdb9222c0edf3dee3e3f7b0ce43c66fdc88
7
+ data.tar.gz: c2f74f060a6377105a8ce155bd635d0892867c02e410a79c969055259b93b825a92227aaae7b45c4c6c76c535c410cbe0ee03f54086016428441eaa432b19067
@@ -1,3 +1,3 @@
1
1
  module DddDomain
2
- VERSION = "1.2.3"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -1,7 +1,7 @@
1
- require 'test_helper'
1
+ require "test_helper"
2
2
 
3
3
  class DddDomainTest < ActiveSupport::TestCase
4
- test "truth" do
5
- assert_kind_of Module, DddDomain
4
+ test "it has a version number" do
5
+ assert DddDomain::VERSION
6
6
  end
7
7
  end
data/test/dummy/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  # Add your own tasks in files placed in lib/tasks ending in .rake,
2
2
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
3
 
4
- require File.expand_path('../config/application', __FILE__)
4
+ require_relative "config/application"
5
5
 
6
6
  Rails.application.load_tasks
@@ -1,15 +1 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any styles
10
- * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
- * file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
1
+ /* Application styles */
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -1,5 +1,2 @@
1
1
  class ApplicationController < ActionController::Base
2
- # Prevent CSRF attacks by raising an exception.
3
- # For APIs, you may want to use :null_session instead.
4
- protect_from_forgery with: :exception
5
2
  end
@@ -0,0 +1,7 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ # Automatically retry jobs that encountered a deadlock
3
+ # retry_on ActiveRecord::Deadlocked
4
+
5
+ # Most jobs are safe to ignore if the underlying records are no longer available
6
+ # discard_on ActiveJob::DeserializationError
7
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: "from@example.com"
3
+ layout "mailer"
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ primary_abstract_class
3
+ end
@@ -1,14 +1,15 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
- <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%= csrf_meta_tags %>
7
+ <%= csp_meta_tag %>
10
8
 
11
- <%= yield %>
9
+ <%= stylesheet_link_tag "application" %>
10
+ </head>
12
11
 
13
- </body>
12
+ <body>
13
+ <%= yield %>
14
+ </body>
14
15
  </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <%= yield %>
data/test/dummy/bin/rails CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
3
- require_relative '../config/boot'
4
- require 'rails/commands'
2
+ APP_PATH = File.expand_path("../config/application", __dir__)
3
+ require_relative "../config/boot"
4
+ require "rails/commands"
data/test/dummy/bin/rake CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- require_relative '../config/boot'
3
- require 'rake'
2
+ require_relative "../config/boot"
3
+ require "rake"
4
4
  Rake.application.run
data/test/dummy/bin/setup CHANGED
@@ -1,29 +1,33 @@
1
1
  #!/usr/bin/env ruby
2
- require 'pathname'
2
+ require "fileutils"
3
3
 
4
4
  # path to your application root.
5
- APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
5
+ APP_ROOT = File.expand_path("..", __dir__)
6
6
 
7
- Dir.chdir APP_ROOT do
8
- # This script is a starting point to setup your application.
9
- # Add necessary setup steps to this file:
7
+ def system!(*args)
8
+ system(*args) || abort("\n== Command #{args} failed ==")
9
+ end
10
+
11
+ FileUtils.chdir APP_ROOT do
12
+ # This script is a way to set up or update your development environment automatically.
13
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
14
+ # Add necessary setup steps to this file.
10
15
 
11
16
  puts "== Installing dependencies =="
12
- system "gem install bundler --conservative"
13
- system "bundle check || bundle install"
17
+ system! "gem install bundler --conservative"
18
+ system("bundle check") || system!("bundle install")
14
19
 
15
20
  # puts "\n== Copying sample files =="
16
21
  # unless File.exist?("config/database.yml")
17
- # system "cp config/database.yml.sample config/database.yml"
22
+ # FileUtils.cp "config/database.yml.sample", "config/database.yml"
18
23
  # end
19
24
 
20
25
  puts "\n== Preparing database =="
21
- system "bin/rake db:setup"
26
+ system! "bin/rails db:prepare"
22
27
 
23
28
  puts "\n== Removing old logs and tempfiles =="
24
- system "rm -f log/*"
25
- system "rm -rf tmp/cache"
29
+ system! "bin/rails log:clear tmp:clear"
26
30
 
27
31
  puts "\n== Restarting application server =="
28
- system "touch tmp/restart.txt"
32
+ system! "bin/rails restart"
29
33
  end
@@ -1,26 +1,22 @@
1
- require File.expand_path('../boot', __FILE__)
1
+ require_relative "boot"
2
2
 
3
- require 'rails/all'
3
+ require "rails/all"
4
4
 
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
5
7
  Bundler.require(*Rails.groups)
6
8
  require "ddd_domain"
7
9
 
8
10
  module Dummy
9
11
  class Application < Rails::Application
10
- # Settings in config/environments/* take precedence over those specified here.
11
- # Application configuration should go into files in config/initializers
12
- # -- all .rb files in that directory are automatically loaded.
12
+ config.load_defaults Rails::VERSION::STRING.to_f
13
13
 
14
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16
- # config.time_zone = 'Central Time (US & Canada)'
17
-
18
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
- # config.i18n.default_locale = :de
21
-
22
- # Do not swallow errors in after_commit/after_rollback callbacks.
23
- Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
14
+ # Configuration for the application, engines, and railties goes here.
15
+ #
16
+ # These settings can be overridden in specific environments using the files
17
+ # in config/environments, which are processed later.
18
+ #
19
+ # config.time_zone = "Central Time (US & Canada)"
20
+ # config.eager_load_paths << Rails.root.join("extras")
24
21
  end
25
22
  end
26
-
@@ -1,5 +1,5 @@
1
1
  # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
2
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)
3
3
 
4
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
- $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
4
+ require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
5
+ $LOAD_PATH.unshift File.expand_path("../../../lib", __dir__)
@@ -0,0 +1,10 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: test
6
+
7
+ production:
8
+ adapter: redis
9
+ url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10
+ channel_prefix: dummy_production
@@ -1,12 +1,12 @@
1
- # SQLite version 3.x
1
+ # SQLite. Versions 3.8.0 and up are supported.
2
2
  # gem install sqlite3
3
3
  #
4
4
  # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
5
+ # gem "sqlite3"
6
6
  #
7
7
  default: &default
8
8
  adapter: sqlite3
9
- pool: 5
9
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
10
  timeout: 5000
11
11
 
12
12
  development:
@@ -1,5 +1,5 @@
1
1
  # Load the Rails application.
2
- require File.expand_path('../application', __FILE__)
2
+ require_relative "application"
3
3
 
4
4
  # Initialize the Rails application.
5
5
  Rails.application.initialize!
@@ -1,41 +1,68 @@
1
+ require "active_support/core_ext/integer/time"
2
+
1
3
  Rails.application.configure do
2
4
  # Settings specified here will take precedence over those in config/application.rb.
3
5
 
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
+ # In the development environment your application's code is reloaded any time
7
+ # it changes. This slows down response time but is perfect for development
6
8
  # since you don't have to restart the web server when you make code changes.
7
9
  config.cache_classes = false
8
10
 
9
11
  # Do not eager load code on boot.
10
12
  config.eager_load = false
11
13
 
12
- # Show full error reports and disable caching.
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
14
+ # Show full error reports.
15
+ config.consider_all_requests_local = true
16
+
17
+ # Enable server timing
18
+ config.server_timing = true
19
+
20
+ # Enable/disable caching. By default caching is disabled.
21
+ # Run rails dev:cache to toggle caching.
22
+ if Rails.root.join("tmp/caching-dev.txt").exist?
23
+ config.action_controller.perform_caching = true
24
+ config.action_controller.enable_fragment_cache_logging = true
25
+
26
+ config.cache_store = :memory_store
27
+ config.public_file_server.headers = {
28
+ "Cache-Control" => "public, max-age=#{2.days.to_i}"
29
+ }
30
+ else
31
+ config.action_controller.perform_caching = false
32
+
33
+ config.cache_store = :null_store
34
+ end
35
+
36
+ # Store uploaded files on the local file system (see config/storage.yml for options).
37
+ config.active_storage.service = :local
15
38
 
16
39
  # Don't care if the mailer can't send.
17
40
  config.action_mailer.raise_delivery_errors = false
18
41
 
42
+ config.action_mailer.perform_caching = false
43
+
19
44
  # Print deprecation notices to the Rails logger.
20
45
  config.active_support.deprecation = :log
21
46
 
47
+ # Raise exceptions for disallowed deprecations.
48
+ config.active_support.disallowed_deprecation = :raise
49
+
50
+ # Tell Active Support which deprecation messages to disallow.
51
+ config.active_support.disallowed_deprecation_warnings = []
52
+
22
53
  # Raise an error on page load if there are pending migrations.
23
54
  config.active_record.migration_error = :page_load
24
55
 
25
- # Debug mode disables concatenation and preprocessing of assets.
26
- # This option may cause significant delays in view rendering with a large
27
- # number of complex assets.
28
- config.assets.debug = true
56
+ # Highlight code that triggered database queries in logs.
57
+ config.active_record.verbose_query_logs = true
58
+
29
59
 
30
- # Asset digests allow you to set far-future HTTP expiration dates on all assets,
31
- # yet still be able to expire them through the digest params.
32
- config.assets.digest = true
60
+ # Raises error for missing translations.
61
+ # config.i18n.raise_on_missing_translations = true
33
62
 
34
- # Adds additional error checking when serving assets at runtime.
35
- # Checks for improperly declared sprockets dependencies.
36
- # Raises helpful error messages.
37
- config.assets.raise_runtime_errors = true
63
+ # Annotate rendered view with file names.
64
+ # config.action_view.annotate_rendered_view_with_filenames = true
38
65
 
39
- # Raises error for missing translations
40
- # config.action_view.raise_on_missing_translations = true
66
+ # Uncomment if you wish to allow Action Cable access from any origin.
67
+ # config.action_cable.disable_request_forgery_protection = true
41
68
  end
@@ -1,3 +1,5 @@
1
+ require "active_support/core_ext/integer/time"
2
+
1
3
  Rails.application.configure do
2
4
  # Settings specified here will take precedence over those in config/application.rb.
3
5
 
@@ -14,51 +16,47 @@ Rails.application.configure do
14
16
  config.consider_all_requests_local = false
15
17
  config.action_controller.perform_caching = true
16
18
 
17
- # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
- # Add `rack-cache` to your Gemfile before enabling this.
19
- # For large-scale production use, consider using a caching reverse proxy like
20
- # NGINX, varnish or squid.
21
- # config.action_dispatch.rack_cache = true
19
+ # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
20
+ # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
21
+ # config.require_master_key = true
22
22
 
23
23
  # Disable serving static files from the `/public` folder by default since
24
24
  # Apache or NGINX already handles this.
25
- config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
26
-
27
- # Compress JavaScripts and CSS.
28
- config.assets.js_compressor = :uglifier
29
- # config.assets.css_compressor = :sass
25
+ config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
30
26
 
31
- # Do not fallback to assets pipeline if a precompiled asset is missed.
32
- config.assets.compile = false
27
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
28
+ # config.asset_host = "http://assets.example.com"
33
29
 
34
- # Asset digests allow you to set far-future HTTP expiration dates on all assets,
35
- # yet still be able to expire them through the digest params.
36
- config.assets.digest = true
30
+ # Specifies the header that your server uses for sending files.
31
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
32
+ # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
37
33
 
38
- # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
34
+ # Store uploaded files on the local file system (see config/storage.yml for options).
35
+ config.active_storage.service = :local
39
36
 
40
- # Specifies the header that your server uses for sending files.
41
- # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
37
+ # Mount Action Cable outside main process or domain.
38
+ # config.action_cable.mount_path = nil
39
+ # config.action_cable.url = "wss://example.com/cable"
40
+ # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
43
41
 
44
42
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45
43
  # config.force_ssl = true
46
44
 
47
- # Use the lowest log level to ensure availability of diagnostic information
48
- # when problems arise.
49
- config.log_level = :debug
45
+ # Include generic and useful information about system operation, but avoid logging too much
46
+ # information to avoid inadvertent exposure of personally identifiable information (PII).
47
+ config.log_level = :info
50
48
 
51
49
  # Prepend all log lines with the following tags.
52
- # config.log_tags = [ :subdomain, :uuid ]
53
-
54
- # Use a different logger for distributed setups.
55
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
50
+ config.log_tags = [ :request_id ]
56
51
 
57
52
  # Use a different cache store in production.
58
53
  # config.cache_store = :mem_cache_store
59
54
 
60
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
61
- # config.action_controller.asset_host = 'http://assets.example.com'
55
+ # Use a real queuing backend for Active Job (and separate queues per environment).
56
+ # config.active_job.queue_adapter = :resque
57
+ # config.active_job.queue_name_prefix = "dummy_production"
58
+
59
+ config.action_mailer.perform_caching = false
62
60
 
63
61
  # Ignore bad email addresses and do not raise email delivery errors.
64
62
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
@@ -68,12 +66,22 @@ Rails.application.configure do
68
66
  # the I18n.default_locale when a translation cannot be found).
69
67
  config.i18n.fallbacks = true
70
68
 
71
- # Send deprecation notices to registered listeners.
72
- config.active_support.deprecation = :notify
69
+ # Don't log any deprecations.
70
+ config.active_support.report_deprecations = false
73
71
 
74
72
  # Use default logging formatter so that PID and timestamp are not suppressed.
75
73
  config.log_formatter = ::Logger::Formatter.new
76
74
 
75
+ # Use a different logger for distributed setups.
76
+ # require "syslog/logger"
77
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
78
+
79
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
80
+ logger = ActiveSupport::Logger.new(STDOUT)
81
+ logger.formatter = config.log_formatter
82
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
83
+ end
84
+
77
85
  # Do not dump schema after migrations.
78
86
  config.active_record.dump_schema_after_migration = false
79
87
  end
@@ -1,24 +1,31 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ # The test environment is used exclusively to run your application's
4
+ # test suite. You never need to work with it otherwise. Remember that
5
+ # your test database is "scratch space" for the test suite and is wiped
6
+ # and recreated between test runs. Don't rely on the data there!
7
+
1
8
  Rails.application.configure do
2
9
  # Settings specified here will take precedence over those in config/application.rb.
3
10
 
4
- # The test environment is used exclusively to run your application's
5
- # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
11
+ # Turn false under Spring and add config.action_view.cache_template_loading = true.
8
12
  config.cache_classes = true
9
13
 
10
- # Do not eager load code on boot. This avoids loading your whole application
11
- # just for the purpose of running a single test. If you are using a tool that
12
- # preloads Rails for running tests, you may have to set it to true.
13
- config.eager_load = false
14
+ # Eager loading loads your whole application. When running a single test locally,
15
+ # this probably isn't necessary. It's a good idea to do in a continuous integration
16
+ # system, or in some way before deploying your code.
17
+ config.eager_load = ENV["CI"].present?
14
18
 
15
- # Configure static file server for tests with Cache-Control for performance.
16
- config.serve_static_files = true
17
- config.static_cache_control = 'public, max-age=3600'
19
+ # Configure public file server for tests with Cache-Control for performance.
20
+ config.public_file_server.enabled = true
21
+ config.public_file_server.headers = {
22
+ "Cache-Control" => "public, max-age=#{1.hour.to_i}"
23
+ }
18
24
 
19
25
  # Show full error reports and disable caching.
20
26
  config.consider_all_requests_local = true
21
27
  config.action_controller.perform_caching = false
28
+ config.cache_store = :null_store
22
29
 
23
30
  # Raise exceptions instead of rendering exception templates.
24
31
  config.action_dispatch.show_exceptions = false
@@ -26,17 +33,28 @@ Rails.application.configure do
26
33
  # Disable request forgery protection in test environment.
27
34
  config.action_controller.allow_forgery_protection = false
28
35
 
36
+ # Store uploaded files on the local file system in a temporary directory.
37
+ config.active_storage.service = :test
38
+
39
+ config.action_mailer.perform_caching = false
40
+
29
41
  # Tell Action Mailer not to deliver emails to the real world.
30
42
  # The :test delivery method accumulates sent emails in the
31
43
  # ActionMailer::Base.deliveries array.
32
44
  config.action_mailer.delivery_method = :test
33
45
 
34
- # Randomize the order test cases are executed.
35
- config.active_support.test_order = :random
36
-
37
46
  # Print deprecation notices to the stderr.
38
47
  config.active_support.deprecation = :stderr
39
48
 
40
- # Raises error for missing translations
41
- # config.action_view.raise_on_missing_translations = true
49
+ # Raise exceptions for disallowed deprecations.
50
+ config.active_support.disallowed_deprecation = :raise
51
+
52
+ # Tell Active Support which deprecation messages to disallow.
53
+ config.active_support.disallowed_deprecation_warnings = []
54
+
55
+ # Raises error for missing translations.
56
+ # config.i18n.raise_on_missing_translations = true
57
+
58
+ # Annotate rendered view with file names.
59
+ # config.action_view.annotate_rendered_view_with_filenames = true
42
60
  end
@@ -0,0 +1,26 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Define an application-wide content security policy
4
+ # For further information see the following documentation
5
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6
+
7
+ # Rails.application.configure do
8
+ # config.content_security_policy do |policy|
9
+ # policy.default_src :self, :https
10
+ # policy.font_src :self, :https, :data
11
+ # policy.img_src :self, :https, :data
12
+ # policy.object_src :none
13
+ # policy.script_src :self, :https
14
+ # policy.style_src :self, :https
15
+ # # Specify URI for violation reports
16
+ # # policy.report_uri "/csp-violation-report-endpoint"
17
+ # end
18
+ #
19
+ # # Generate session nonces for permitted importmap and inline scripts
20
+ # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21
+ # config.content_security_policy_nonce_directives = %w(script-src)
22
+ #
23
+ # # Report CSP violations to a specified URI. See:
24
+ # # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
25
+ # # config.content_security_policy_report_only = true
26
+ # end
@@ -1,4 +1,8 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- # Configure sensitive parameters which will be filtered from the log file.
4
- Rails.application.config.filter_parameters += [:password]
3
+ # Configure parameters to be filtered from the log file. Use this to limit dissemination of
4
+ # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
5
+ # notations and behaviors.
6
+ Rails.application.config.filter_parameters += [
7
+ :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
8
+ ]
@@ -4,13 +4,13 @@
4
4
  # are locale specific, and you may define rules for as many different
5
5
  # locales as you wish. All of these examples are active by default:
6
6
  # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
- # inflect.plural /^(ox)$/i, '\1en'
8
- # inflect.singular /^(ox)en/i, '\1'
9
- # inflect.irregular 'person', 'people'
7
+ # inflect.plural /^(ox)$/i, "\\1en"
8
+ # inflect.singular /^(ox)en/i, "\\1"
9
+ # inflect.irregular "person", "people"
10
10
  # inflect.uncountable %w( fish sheep )
11
11
  # end
12
12
 
13
13
  # These inflection rules are supported but not enabled by default:
14
14
  # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
- # inflect.acronym 'RESTful'
15
+ # inflect.acronym "RESTful"
16
16
  # end
@@ -0,0 +1,11 @@
1
+ # Define an application-wide HTTP permissions policy. For further
2
+ # information see https://developers.google.com/web/updates/2018/06/feature-policy
3
+ #
4
+ # Rails.application.config.permissions_policy do |f|
5
+ # f.camera :none
6
+ # f.gyroscope :none
7
+ # f.microphone :none
8
+ # f.usb :none
9
+ # f.fullscreen :self
10
+ # f.payment :self, "https://secure.example.com"
11
+ # end