railties 6.0.4.3 → 6.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +234 -420
  3. data/MIT-LICENSE +1 -1
  4. data/RDOC_MAIN.rdoc +1 -1
  5. data/README.rdoc +1 -1
  6. data/lib/minitest/rails_plugin.rb +16 -1
  7. data/lib/rails/api/task.rb +1 -1
  8. data/lib/rails/application/bootstrap.rb +5 -5
  9. data/lib/rails/application/configuration.rb +72 -22
  10. data/lib/rails/application/default_middleware_stack.rb +5 -3
  11. data/lib/rails/application/finisher.rb +15 -2
  12. data/lib/rails/application/routes_reloader.rb +9 -2
  13. data/lib/rails/application.rb +45 -79
  14. data/lib/rails/backtrace_cleaner.rb +12 -7
  15. data/lib/rails/code_statistics.rb +3 -3
  16. data/lib/rails/code_statistics_calculator.rb +6 -6
  17. data/lib/rails/command/base.rb +1 -1
  18. data/lib/rails/command/behavior.rb +1 -1
  19. data/lib/rails/command/environment_argument.rb +1 -1
  20. data/lib/rails/command.rb +7 -1
  21. data/lib/rails/commands/credentials/USAGE +17 -2
  22. data/lib/rails/commands/credentials/credentials_command/diffing.rb +41 -0
  23. data/lib/rails/commands/credentials/credentials_command.rb +28 -4
  24. data/lib/rails/commands/db/system/change/change_command.rb +6 -1
  25. data/lib/rails/commands/dbconsole/dbconsole_command.rb +61 -58
  26. data/lib/rails/commands/encrypted/encrypted_command.rb +4 -4
  27. data/lib/rails/commands/generate/generate_command.rb +1 -1
  28. data/lib/rails/commands/notes/notes_command.rb +3 -13
  29. data/lib/rails/commands/rake/rake_command.rb +9 -8
  30. data/lib/rails/commands/secrets/USAGE +9 -3
  31. data/lib/rails/commands/server/server_command.rb +14 -41
  32. data/lib/rails/commands/test/test_command.rb +2 -2
  33. data/lib/rails/configuration.rb +40 -10
  34. data/lib/rails/engine/configuration.rb +1 -0
  35. data/lib/rails/engine/updater.rb +1 -1
  36. data/lib/rails/engine.rb +35 -32
  37. data/lib/rails/gem_version.rb +3 -3
  38. data/lib/rails/generators/actions/create_migration.rb +5 -0
  39. data/lib/rails/generators/actions.rb +50 -29
  40. data/lib/rails/generators/app_base.rb +39 -22
  41. data/lib/rails/generators/base.rb +14 -11
  42. data/lib/rails/generators/database.rb +3 -4
  43. data/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +3 -3
  44. data/lib/rails/generators/generated_attribute.rb +3 -9
  45. data/lib/rails/generators/migration.rb +2 -1
  46. data/lib/rails/generators/model_helpers.rb +26 -2
  47. data/lib/rails/generators/named_base.rb +1 -1
  48. data/lib/rails/generators/rails/app/USAGE +2 -1
  49. data/lib/rails/generators/rails/app/app_generator.rb +89 -15
  50. data/lib/rails/generators/rails/app/templates/Gemfile.tt +11 -11
  51. data/lib/rails/generators/rails/app/templates/Rakefile.tt +1 -1
  52. data/lib/rails/generators/rails/app/templates/app/javascript/channels/consumer.js +1 -1
  53. data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +11 -11
  54. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +2 -1
  55. data/lib/rails/generators/rails/app/templates/bin/rails.tt +5 -2
  56. data/lib/rails/generators/rails/app/templates/bin/rake.tt +5 -2
  57. data/lib/rails/generators/rails/app/templates/bin/setup.tt +4 -4
  58. data/lib/rails/generators/rails/app/templates/bin/spring.tt +13 -0
  59. data/lib/rails/generators/rails/app/templates/bin/yarn.tt +9 -3
  60. data/lib/rails/generators/rails/app/templates/config/application.rb.tt +14 -7
  61. data/lib/rails/generators/rails/app/templates/config/boot.rb.tt +2 -2
  62. data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +3 -4
  63. data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +10 -9
  64. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +11 -10
  65. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +10 -9
  66. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +11 -10
  67. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +11 -10
  68. data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +10 -9
  69. data/lib/rails/generators/rails/app/templates/config/environment.rb.tt +1 -1
  70. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +17 -3
  71. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +15 -5
  72. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +12 -1
  73. data/lib/rails/generators/rails/app/templates/config/initializers/backtrace_silencers.rb.tt +4 -3
  74. data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +3 -1
  75. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt +67 -0
  76. data/lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt +11 -0
  77. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +6 -1
  78. data/lib/rails/generators/rails/app/templates/config.ru.tt +2 -1
  79. data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +1 -1
  80. data/lib/rails/generators/rails/app/templates/gitattributes.tt +14 -0
  81. data/lib/rails/generators/rails/app/templates/gitignore.tt +0 -1
  82. data/lib/rails/generators/rails/app/templates/package.json.tt +1 -1
  83. data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +5 -5
  84. data/lib/rails/generators/rails/assets/USAGE +2 -3
  85. data/lib/rails/generators/rails/benchmark/USAGE +19 -0
  86. data/lib/rails/generators/rails/benchmark/benchmark_generator.rb +29 -0
  87. data/lib/rails/generators/rails/benchmark/templates/benchmark.rb.tt +15 -0
  88. data/lib/rails/generators/rails/controller/USAGE +2 -2
  89. data/lib/rails/generators/rails/controller/controller_generator.rb +2 -40
  90. data/lib/rails/generators/rails/credentials/credentials_generator.rb +1 -1
  91. data/lib/rails/generators/rails/generator/USAGE +2 -2
  92. data/lib/rails/generators/rails/generator/templates/USAGE.tt +1 -1
  93. data/lib/rails/generators/rails/helper/USAGE +2 -3
  94. data/lib/rails/generators/rails/integration_test/USAGE +2 -2
  95. data/lib/rails/generators/rails/migration/USAGE +4 -4
  96. data/lib/rails/generators/rails/model/USAGE +15 -16
  97. data/lib/rails/generators/rails/plugin/plugin_generator.rb +25 -23
  98. data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +10 -19
  99. data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +3 -10
  100. data/lib/rails/generators/rails/plugin/templates/Rakefile.tt +4 -18
  101. data/lib/rails/generators/rails/plugin/templates/app/controllers/%namespaced_name%/application_controller.rb.tt +0 -1
  102. data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +3 -3
  103. data/lib/rails/generators/rails/plugin/templates/gitignore.tt +13 -11
  104. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%.rb.tt +1 -0
  105. data/lib/rails/generators/rails/plugin/templates/rails/boot.rb.tt +1 -1
  106. data/lib/rails/generators/rails/plugin/templates/test/%namespaced_name%_test.rb.tt +4 -4
  107. data/lib/rails/generators/rails/plugin/templates/test/integration/navigation_test.rb.tt +1 -1
  108. data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +0 -3
  109. data/lib/rails/generators/rails/resource/USAGE +4 -4
  110. data/lib/rails/generators/rails/resource_route/resource_route_generator.rb +2 -27
  111. data/lib/rails/generators/rails/scaffold/USAGE +5 -5
  112. data/lib/rails/generators/rails/scaffold_controller/USAGE +2 -2
  113. data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +6 -0
  114. data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +1 -1
  115. data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +1 -1
  116. data/lib/rails/generators/rails/system_test/USAGE +2 -2
  117. data/lib/rails/generators/rails/task/USAGE +3 -3
  118. data/lib/rails/generators/test_case.rb +1 -1
  119. data/lib/rails/generators/test_unit/controller/controller_generator.rb +2 -0
  120. data/lib/rails/generators/test_unit/controller/templates/functional_test.rb.tt +3 -3
  121. data/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt +2 -2
  122. data/lib/rails/generators/test_unit/integration/templates/integration_test.rb.tt +1 -1
  123. data/lib/rails/generators/test_unit/job/templates/unit_test.rb.tt +1 -1
  124. data/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt +1 -1
  125. data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +1 -1
  126. data/lib/rails/generators/test_unit/model/templates/unit_test.rb.tt +1 -1
  127. data/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt +1 -1
  128. data/lib/rails/generators/test_unit/plugin/templates/test_helper.rb +2 -2
  129. data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +1 -1
  130. data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +1 -1
  131. data/lib/rails/generators/testing/assertions.rb +2 -2
  132. data/lib/rails/generators/testing/behaviour.rb +1 -1
  133. data/lib/rails/generators.rb +29 -15
  134. data/lib/rails/info.rb +1 -1
  135. data/lib/rails/info_controller.rb +1 -1
  136. data/lib/rails/mailers_controller.rb +1 -0
  137. data/lib/rails/paths.rb +14 -6
  138. data/lib/rails/railtie/configuration.rb +3 -2
  139. data/lib/rails/railtie.rb +31 -10
  140. data/lib/rails/source_annotation_extractor.rb +1 -15
  141. data/lib/rails/tasks/engine.rake +1 -4
  142. data/lib/rails/tasks/framework.rake +7 -1
  143. data/lib/rails/tasks/misc.rake +1 -1
  144. data/lib/rails/tasks/statistics.rake +1 -1
  145. data/lib/rails/tasks/yarn.rake +14 -2
  146. data/lib/rails/tasks.rb +0 -4
  147. data/lib/rails/templates/rails/mailers/email.html.erb +1 -0
  148. data/lib/rails/templates/rails/welcome/index.html.erb +1 -1
  149. data/lib/rails/test_unit/reporter.rb +2 -1
  150. data/lib/rails/test_unit/runner.rb +12 -3
  151. data/lib/rails/test_unit/testing.rake +6 -0
  152. data/lib/rails.rb +5 -8
  153. metadata +24 -30
  154. data/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml.tt +0 -50
  155. data/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml.tt +0 -86
  156. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_0.rb.tt +0 -45
  157. data/lib/rails/generators/rails/plugin/templates/rails/application.rb.tt +0 -23
  158. data/lib/rails/tasks/annotations.rake +0 -22
  159. data/lib/rails/tasks/dev.rake +0 -11
  160. data/lib/rails/tasks/initializers.rake +0 -9
  161. data/lib/rails/tasks/routes.rake +0 -9
@@ -3,7 +3,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
3
 
4
4
  ruby <%= "'#{RUBY_VERSION}'" -%>
5
5
 
6
- <% unless gemfile_entries.first.comment -%>
6
+ <% unless gemfile_entries.first&.comment -%>
7
7
 
8
8
  <% end -%>
9
9
  <% gemfile_entries.each do |gem| -%>
@@ -14,7 +14,7 @@ ruby <%= "'#{RUBY_VERSION}'" -%>
14
14
  <%= gem.commented_out ? '# ' : '' %>gem '<%= gem.name %>'<%= %(, '#{gem.version}') if gem.version -%>
15
15
  <% if gem.options.any? -%>
16
16
  , <%= gem.options.map { |k,v|
17
- "#{k}: #{v.inspect}" }.join(', ') %>
17
+ "#{k}: #{v.inspect.gsub('"', '\'')}" }.join(', ') %>
18
18
  <% end -%>
19
19
  <% end -%>
20
20
 
@@ -28,7 +28,7 @@ ruby <%= "'#{RUBY_VERSION}'" -%>
28
28
 
29
29
  <% if depend_on_bootsnap? -%>
30
30
  # Reduces boot times through caching; required in config/boot.rb
31
- gem 'bootsnap', '>= 1.4.2', require: false
31
+ gem 'bootsnap', '>= 1.4.4', require: false
32
32
 
33
33
  <%- end -%>
34
34
  <%- if options.api? -%>
@@ -44,30 +44,30 @@ end
44
44
 
45
45
  <% end -%>
46
46
  group :development do
47
- <%- unless options.api? -%>
47
+ <%- unless options.api? || options.skip_dev_gems? -%>
48
48
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
49
- <%- if options.dev? || options.edge? -%>
49
+ <%- if options.dev? || options.edge? || options.master? -%>
50
50
  gem 'web-console', github: 'rails/web-console'
51
51
  <%- else -%>
52
- gem 'web-console', '>= 3.3.0'
52
+ gem 'web-console', '>= 4.1.0'
53
53
  <%- end -%>
54
+ # Display performance information such as SQL time and flame graphs for each request in your browser.
55
+ # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
56
+ gem 'rack-mini-profiler', '~> 2.0'
54
57
  <%- end -%>
55
58
  <% if depend_on_listen? -%>
56
- gem 'listen', '~> 3.2'
59
+ gem 'listen', '~> 3.3'
57
60
  <% end -%>
58
61
  <% if spring_install? -%>
59
62
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
60
63
  gem 'spring'
61
- <% if depend_on_listen? -%>
62
- gem 'spring-watcher-listen', '~> 2.0.0'
63
- <% end -%>
64
64
  <% end -%>
65
65
  end
66
66
 
67
67
  <%- if depends_on_system_test? -%>
68
68
  group :test do
69
69
  # Adds support for Capybara system testing and selenium driver
70
- gem 'capybara', '>= 2.15'
70
+ gem 'capybara', '>= 3.26'
71
71
  gem 'selenium-webdriver'
72
72
  # Easy installation and use of web drivers to run system tests with browsers
73
73
  gem 'webdrivers'
@@ -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_relative 'config/application'
4
+ require_relative "config/application"
5
5
 
6
6
  Rails.application.load_tasks
@@ -1,5 +1,5 @@
1
1
  // Action Cable provides the framework to deal with WebSockets in Rails.
2
- // You can generate new channels where WebSocket features live using the `rails generate channel` command.
2
+ // You can generate new channels where WebSocket features live using the `bin/rails generate channel` command.
3
3
 
4
4
  import { createConsumer } from "@rails/actioncable"
5
5
 
@@ -3,21 +3,21 @@
3
3
  // a relevant structure within app/javascript and only use these pack files to reference
4
4
  // that code so it'll be compiled.
5
5
 
6
- require("@rails/ujs").start()
6
+ import Rails from "@rails/ujs"
7
7
  <%- unless options[:skip_turbolinks] -%>
8
- require("turbolinks").start()
8
+ import Turbolinks from "turbolinks"
9
9
  <%- end -%>
10
10
  <%- unless skip_active_storage? -%>
11
- require("@rails/activestorage").start()
11
+ import * as ActiveStorage from "@rails/activestorage"
12
12
  <%- end -%>
13
13
  <%- unless options[:skip_action_cable] -%>
14
- require("channels")
14
+ import "channels"
15
15
  <%- end -%>
16
16
 
17
-
18
- // Uncomment to copy all static images under ../images to the output folder and reference
19
- // them with the image_pack_tag helper in views (e.g <%%= image_pack_tag 'rails.png' %>)
20
- // or the `imagePath` JavaScript helper below.
21
- //
22
- // const images = require.context('../images', true)
23
- // const imagePath = (name) => images(name, true)
17
+ Rails.start()
18
+ <%- unless options[:skip_turbolinks] -%>
19
+ Turbolinks.start()
20
+ <%- end -%>
21
+ <%- unless skip_active_storage? -%>
22
+ ActiveStorage.start()
23
+ <%- end -%>
@@ -2,11 +2,12 @@
2
2
  <html>
3
3
  <head>
4
4
  <title><%= camelized %></title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
5
6
  <%%= csrf_meta_tags %>
6
7
  <%%= csp_meta_tag %>
7
8
 
8
9
  <%- if options[:skip_javascript] -%>
9
- <%%= stylesheet_link_tag 'application', media: 'all' %>
10
+ <%%= stylesheet_link_tag 'application', media: 'all' %>
10
11
  <%- else -%>
11
12
  <%- unless options[:skip_turbolinks] -%>
12
13
  <%%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
@@ -1,3 +1,6 @@
1
+ <% if spring_install? -%>
2
+ load File.expand_path("spring", __dir__)
3
+ <% end -%>
1
4
  APP_PATH = File.expand_path('../config/application', __dir__)
2
- require_relative '../config/boot'
3
- require 'rails/commands'
5
+ require_relative "../config/boot"
6
+ require "rails/commands"
@@ -1,3 +1,6 @@
1
- require_relative '../config/boot'
2
- require 'rake'
1
+ <% if spring_install? -%>
2
+ load File.expand_path("spring", __dir__)
3
+ <% end -%>
4
+ require_relative "../config/boot"
5
+ require "rake"
3
6
  Rake.application.run
@@ -1,4 +1,4 @@
1
- require 'fileutils'
1
+ require "fileutils"
2
2
 
3
3
  # path to your application root.
4
4
  APP_ROOT = File.expand_path('..', __dir__)
@@ -8,8 +8,8 @@ def system!(*args)
8
8
  end
9
9
 
10
10
  FileUtils.chdir APP_ROOT do
11
- # This script is a way to setup or update your development environment automatically.
12
- # This script is idempotent, so that you can run it at anytime and get an expectable outcome.
11
+ # This script is a way to set up or update your development environment automatically.
12
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
13
13
  # Add necessary setup steps to this file.
14
14
 
15
15
  puts '== Installing dependencies =='
@@ -18,7 +18,7 @@ FileUtils.chdir APP_ROOT do
18
18
  <% unless options.skip_javascript? -%>
19
19
 
20
20
  # Install JavaScript dependencies
21
- # system('bin/yarn')
21
+ system! 'bin/yarn'
22
22
  <% end -%>
23
23
  <% unless options.skip_active_record? -%>
24
24
 
@@ -0,0 +1,13 @@
1
+ if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"])
2
+ gem "bundler"
3
+ require "bundler"
4
+
5
+ # Load Spring without loading other gems in the Gemfile, for speed.
6
+ Bundler.locked_gems.specs.find { |spec| spec.name == "spring" }&.tap do |spring|
7
+ Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
8
+ gem "spring", spring.version
9
+ require "spring/binstub"
10
+ rescue Gem::LoadError
11
+ # Ignore when Spring is not installed.
12
+ end
13
+ end
@@ -1,8 +1,14 @@
1
1
  APP_ROOT = File.expand_path('..', __dir__)
2
2
  Dir.chdir(APP_ROOT) do
3
- begin
4
- exec "yarnpkg", *ARGV
5
- rescue Errno::ENOENT
3
+ yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
4
+ select { |dir| File.expand_path(dir) != __dir__ }.
5
+ product(["yarn", "yarn.exe"]).
6
+ map { |dir, file| File.expand_path(file, dir) }.
7
+ find { |file| File.executable?(file) }
8
+
9
+ if yarn
10
+ exec yarn, *ARGV
11
+ else
6
12
  $stderr.puts "Yarn executable was not detected in the system."
7
13
  $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
8
14
  exit 1
@@ -1,12 +1,12 @@
1
- require_relative 'boot'
1
+ require_relative "boot"
2
2
 
3
3
  <% if include_all_railties? -%>
4
- require 'rails/all'
4
+ require "rails/all"
5
5
  <% else -%>
6
6
  require "rails"
7
7
  # Pick the frameworks you want:
8
8
  require "active_model/railtie"
9
- require "active_job/railtie"
9
+ <%= comment_if :skip_active_job %>require "active_job/railtie"
10
10
  <%= comment_if :skip_active_record %>require "active_record/railtie"
11
11
  <%= comment_if :skip_active_storage %>require "active_storage/engine"
12
12
  require "action_controller/railtie"
@@ -25,13 +25,20 @@ Bundler.require(*Rails.groups)
25
25
 
26
26
  module <%= app_const_base %>
27
27
  class Application < Rails::Application
28
+ <%- if !options.dummy_app? -%>
28
29
  # Initialize configuration defaults for originally generated Rails version.
29
30
  config.load_defaults <%= build(:config_target_version) %>
31
+ <%- else -%>
32
+ config.load_defaults Rails::VERSION::STRING.to_f
33
+ <%- end -%>
30
34
 
31
- # Settings in config/environments/* take precedence over those specified here.
32
- # Application configuration can go into files in config/initializers
33
- # -- all .rb files in that directory are automatically loaded after loading
34
- # the framework and any gems in your application.
35
+ # Configuration for the application, engines, and railties goes here.
36
+ #
37
+ # These settings can be overridden in specific environments using the files
38
+ # in config/environments, which are processed later.
39
+ #
40
+ # config.time_zone = "Central Time (US & Canada)"
41
+ # config.eager_load_paths << Rails.root.join("extras")
35
42
  <%- if options.api? -%>
36
43
 
37
44
  # Only loads a smaller set of middleware suitable for API only apps.
@@ -1,6 +1,6 @@
1
1
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2
2
 
3
- require 'bundler/setup' # Set up gems listed in the Gemfile.
3
+ require "bundler/setup" # Set up gems listed in the Gemfile.
4
4
  <% if depend_on_bootsnap? -%>
5
- require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
5
+ require "bootsnap/setup" # Speed up boot time by caching expensive operations.
6
6
  <%- end -%>
@@ -58,10 +58,9 @@ test:
58
58
  # like your database password, in your source code. If your source code is
59
59
  # ever seen by anyone, they now have access to your database.
60
60
  #
61
- # Instead, provide the password as a unix environment variable when you boot
62
- # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
63
- # for a full rundown on how to provide these environment variables in a
64
- # production deployment.
61
+ # Instead, provide the password as an environment variable when you boot the
62
+ # app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
63
+ # for a full overview on how database connection configuration can be specified.
65
64
  #
66
65
  production:
67
66
  url: jdbc:db://localhost/<%= app_name %>_production
@@ -31,20 +31,21 @@ test:
31
31
  # like your database password, in your source code. If your source code is
32
32
  # ever seen by anyone, they now have access to your database.
33
33
  #
34
- # Instead, provide the password as a unix environment variable when you boot
35
- # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
36
- # for a full rundown on how to provide these environment variables in a
37
- # production deployment.
38
- #
39
- # On Heroku and other platform providers, you may have a full connection URL
40
- # available as an environment variable. For example:
34
+ # Instead, provide the password or a full connection URL as an environment
35
+ # variable when you boot the app. For example:
41
36
  #
42
37
  # DATABASE_URL="mysql://myuser:mypass@localhost/somedatabase"
43
38
  #
44
- # You can use this database configuration with:
39
+ # If the connection URL is provided in the special DATABASE_URL environment
40
+ # variable, Rails will automatically merge its configuration values on top of
41
+ # the values provided in this file. Alternatively, you can specify a connection
42
+ # URL environment variable explicitly:
45
43
  #
46
44
  # production:
47
- # url: <%%= ENV['DATABASE_URL'] %>
45
+ # url: <%%= ENV['MY_APP_DATABASE_URL'] %>
46
+ #
47
+ # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
48
+ # for a full overview on how database connection configuration can be specified.
48
49
  #
49
50
  production:
50
51
  <<: *default
@@ -15,7 +15,7 @@ development:
15
15
  # The specified database role being used to connect to postgres.
16
16
  # To create additional roles in postgres see `$ createuser --help`.
17
17
  # When left blank, postgres will use the default role. This is
18
- # the same name as the operating system user that initialized the database.
18
+ # the same name as the operating system user running Rails.
19
19
  #username: <%= app_name %>
20
20
 
21
21
  # The password associated with the postgres role (username).
@@ -47,20 +47,21 @@ test:
47
47
  # like your database password, in your source code. If your source code is
48
48
  # ever seen by anyone, they now have access to your database.
49
49
  #
50
- # Instead, provide the password as a unix environment variable when you boot
51
- # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
52
- # for a full rundown on how to provide these environment variables in a
53
- # production deployment.
54
- #
55
- # On Heroku and other platform providers, you may have a full connection URL
56
- # available as an environment variable. For example:
50
+ # Instead, provide the password or a full connection URL as an environment
51
+ # variable when you boot the app. For example:
57
52
  #
58
53
  # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
59
54
  #
60
- # You can use this database configuration with:
55
+ # If the connection URL is provided in the special DATABASE_URL environment
56
+ # variable, Rails will automatically merge its configuration values on top of
57
+ # the values provided in this file. Alternatively, you can specify a connection
58
+ # URL environment variable explicitly:
61
59
  #
62
60
  # production:
63
- # url: <%%= ENV['DATABASE_URL'] %>
61
+ # url: <%%= ENV['MY_APP_DATABASE_URL'] %>
62
+ #
63
+ # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
64
+ # for a full overview on how database connection configuration can be specified.
64
65
  #
65
66
  production:
66
67
  <<: *default
@@ -36,20 +36,21 @@ test:
36
36
  # like your database password, in your source code. If your source code is
37
37
  # ever seen by anyone, they now have access to your database.
38
38
  #
39
- # Instead, provide the password as a unix environment variable when you boot
40
- # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
41
- # for a full rundown on how to provide these environment variables in a
42
- # production deployment.
43
- #
44
- # On Heroku and other platform providers, you may have a full connection URL
45
- # available as an environment variable. For example:
39
+ # Instead, provide the password or a full connection URL as an environment
40
+ # variable when you boot the app. For example:
46
41
  #
47
42
  # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
48
43
  #
49
- # You can use this database configuration with:
44
+ # If the connection URL is provided in the special DATABASE_URL environment
45
+ # variable, Rails will automatically merge its configuration values on top of
46
+ # the values provided in this file. Alternatively, you can specify a connection
47
+ # URL environment variable explicitly:
50
48
  #
51
49
  # production:
52
- # url: <%%= ENV['DATABASE_URL'] %>
50
+ # url: <%%= ENV['MY_APP_DATABASE_URL'] %>
51
+ #
52
+ # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
53
+ # for a full overview on how database connection configuration can be specified.
53
54
  #
54
55
  production:
55
56
  <<: *default
@@ -37,22 +37,23 @@ test:
37
37
  # like your database password, in your source code. If your source code is
38
38
  # ever seen by anyone, they now have access to your database.
39
39
  #
40
- # Instead, provide the password as a unix environment variable when you boot
41
- # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
42
- # for a full rundown on how to provide these environment variables in a
43
- # production deployment.
44
- #
45
- # On Heroku and other platform providers, you may have a full connection URL
46
- # available as an environment variable. For example:
40
+ # Instead, provide the password or a full connection URL as an environment
41
+ # variable when you boot the app. For example:
47
42
  #
48
43
  # DATABASE_URL="oracle-enhanced://myuser:mypass@localhost/somedatabase"
49
44
  #
50
- # Note that the adapter name uses a dash instead of an underscore.
45
+ # (Note that the adapter name uses a dash instead of an underscore.)
51
46
  #
52
- # You can use this database configuration with:
47
+ # If the connection URL is provided in the special DATABASE_URL environment
48
+ # variable, Rails will automatically merge its configuration values on top of
49
+ # the values provided in this file. Alternatively, you can specify a connection
50
+ # URL environment variable explicitly:
53
51
  #
54
52
  # production:
55
- # url: <%%= ENV['DATABASE_URL'] %>
53
+ # url: <%%= ENV['MY_APP_DATABASE_URL'] %>
54
+ #
55
+ # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
56
+ # for a full overview on how database connection configuration can be specified.
56
57
  #
57
58
  production:
58
59
  <<: *default
@@ -28,7 +28,7 @@ development:
28
28
  # The specified database role being used to connect to postgres.
29
29
  # To create additional roles in postgres see `$ createuser --help`.
30
30
  # When left blank, postgres will use the default role. This is
31
- # the same name as the operating system user that initialized the database.
31
+ # the same name as the operating system user running Rails.
32
32
  #username: <%= app_name %>
33
33
 
34
34
  # The password associated with the postgres role (username).
@@ -63,20 +63,21 @@ test:
63
63
  # like your database password, in your source code. If your source code is
64
64
  # ever seen by anyone, they now have access to your database.
65
65
  #
66
- # Instead, provide the password as a unix environment variable when you boot
67
- # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
68
- # for a full rundown on how to provide these environment variables in a
69
- # production deployment.
70
- #
71
- # On Heroku and other platform providers, you may have a full connection URL
72
- # available as an environment variable. For example:
66
+ # Instead, provide the password or a full connection URL as an environment
67
+ # variable when you boot the app. For example:
73
68
  #
74
69
  # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
75
70
  #
76
- # You can use this database configuration with:
71
+ # If the connection URL is provided in the special DATABASE_URL environment
72
+ # variable, Rails will automatically merge its configuration values on top of
73
+ # the values provided in this file. Alternatively, you can specify a connection
74
+ # URL environment variable explicitly:
77
75
  #
78
76
  # production:
79
- # url: <%%= ENV['DATABASE_URL'] %>
77
+ # url: <%%= ENV['MY_APP_DATABASE_URL'] %>
78
+ #
79
+ # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
80
+ # for a full overview on how database connection configuration can be specified.
80
81
  #
81
82
  production:
82
83
  <<: *default
@@ -30,20 +30,21 @@ test:
30
30
  # like your database password, in your source code. If your source code is
31
31
  # ever seen by anyone, they now have access to your database.
32
32
  #
33
- # Instead, provide the password as a unix environment variable when you boot
34
- # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
35
- # for a full rundown on how to provide these environment variables in a
36
- # production deployment.
37
- #
38
- # On Heroku and other platform providers, you may have a full connection URL
39
- # available as an environment variable. For example:
33
+ # Instead, provide the password or a full connection URL as an environment
34
+ # variable when you boot the app. For example:
40
35
  #
41
36
  # DATABASE_URL="sqlserver://myuser:mypass@localhost/somedatabase"
42
37
  #
43
- # You can use this database configuration with:
38
+ # If the connection URL is provided in the special DATABASE_URL environment
39
+ # variable, Rails will automatically merge its configuration values on top of
40
+ # the values provided in this file. Alternatively, you can specify a connection
41
+ # URL environment variable explicitly:
44
42
  #
45
43
  # production:
46
- # url: <%%= ENV['DATABASE_URL'] %>
44
+ # url: <%%= ENV['MY_APP_DATABASE_URL'] %>
45
+ #
46
+ # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
47
+ # for a full overview on how database connection configuration can be specified.
47
48
  #
48
49
  production:
49
50
  <<: *default
@@ -1,5 +1,5 @@
1
1
  # Load the Rails application.
2
- require_relative 'application'
2
+ require_relative "application"
3
3
 
4
4
  # Initialize the Rails application.
5
5
  Rails.application.initialize!
@@ -1,8 +1,10 @@
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
 
@@ -45,6 +47,12 @@ Rails.application.configure do
45
47
  # Print deprecation notices to the Rails logger.
46
48
  config.active_support.deprecation = :log
47
49
 
50
+ # Raise exceptions for disallowed deprecations.
51
+ config.active_support.disallowed_deprecation = :raise
52
+
53
+ # Tell Active Support which deprecation messages to disallow.
54
+ config.active_support.disallowed_deprecation_warnings = []
55
+
48
56
  <%- unless options.skip_active_record? -%>
49
57
  # Raise an error on page load if there are pending migrations.
50
58
  config.active_record.migration_error = :page_load
@@ -64,9 +72,15 @@ Rails.application.configure do
64
72
  <%- end -%>
65
73
 
66
74
  # Raises error for missing translations.
67
- # config.action_view.raise_on_missing_translations = true
75
+ # config.i18n.raise_on_missing_translations = true
76
+
77
+ # Annotate rendered view with file names.
78
+ # config.action_view.annotate_rendered_view_with_filenames = true
68
79
 
69
80
  # Use an evented file watcher to asynchronously detect changes in source code,
70
81
  # routes, locales, etc. This feature depends on the listen gem.
71
82
  <%= '# ' unless depend_on_listen? %>config.file_watcher = ActiveSupport::EventedFileUpdateChecker
83
+
84
+ # Uncomment if you wish to allow Action Cable access from any origin.
85
+ # config.action_cable.disable_request_forgery_protection = true
72
86
  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
 
@@ -33,7 +35,7 @@ Rails.application.configure do
33
35
 
34
36
  <%- end -%>
35
37
  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
36
- # config.action_controller.asset_host = 'http://assets.example.com'
38
+ # config.asset_host = 'http://assets.example.com'
37
39
 
38
40
  # Specifies the header that your server uses for sending files.
39
41
  # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
@@ -54,9 +56,9 @@ Rails.application.configure do
54
56
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
55
57
  # config.force_ssl = true
56
58
 
57
- # Use the lowest log level to ensure availability of diagnostic information
58
- # when problems arise.
59
- config.log_level = :debug
59
+ # Include generic and useful information about system operation, but avoid logging too much
60
+ # information to avoid inadvertent exposure of personally identifiable information (PII).
61
+ config.log_level = :info
60
62
 
61
63
  # Prepend all log lines with the following tags.
62
64
  config.log_tags = [ :request_id ]
@@ -64,9 +66,11 @@ Rails.application.configure do
64
66
  # Use a different cache store in production.
65
67
  # config.cache_store = :mem_cache_store
66
68
 
69
+ <%- unless options[:skip_active_job] -%>
67
70
  # Use a real queuing backend for Active Job (and separate queues per environment).
68
71
  # config.active_job.queue_adapter = :resque
69
72
  # config.active_job.queue_name_prefix = "<%= app_name %>_production"
73
+ <%- end -%>
70
74
 
71
75
  <%- unless options.skip_action_mailer? -%>
72
76
  config.action_mailer.perform_caching = false
@@ -83,11 +87,17 @@ Rails.application.configure do
83
87
  # Send deprecation notices to registered listeners.
84
88
  config.active_support.deprecation = :notify
85
89
 
90
+ # Log disallowed deprecations.
91
+ config.active_support.disallowed_deprecation = :log
92
+
93
+ # Tell Active Support which deprecation messages to disallow.
94
+ config.active_support.disallowed_deprecation_warnings = []
95
+
86
96
  # Use default logging formatter so that PID and timestamp are not suppressed.
87
97
  config.log_formatter = ::Logger::Formatter.new
88
98
 
89
99
  # Use a different logger for distributed setups.
90
- # require 'syslog/logger'
100
+ # require "syslog/logger"
91
101
  # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
92
102
 
93
103
  if ENV["RAILS_LOG_TO_STDOUT"].present?
@@ -1,3 +1,5 @@
1
+ require "active_support/core_ext/integer/time"
2
+
1
3
  # The test environment is used exclusively to run your application's
2
4
  # test suite. You never need to work with it otherwise. Remember that
3
5
  # your test database is "scratch space" for the test suite and is wiped
@@ -53,6 +55,15 @@ Rails.application.configure do
53
55
  # Print deprecation notices to the stderr.
54
56
  config.active_support.deprecation = :stderr
55
57
 
58
+ # Raise exceptions for disallowed deprecations.
59
+ config.active_support.disallowed_deprecation = :raise
60
+
61
+ # Tell Active Support which deprecation messages to disallow.
62
+ config.active_support.disallowed_deprecation_warnings = []
63
+
56
64
  # Raises error for missing translations.
57
- # config.action_view.raise_on_missing_translations = true
65
+ # config.i18n.raise_on_missing_translations = true
66
+
67
+ # Annotate rendered view with file names.
68
+ # config.action_view.annotate_rendered_view_with_filenames = true
58
69
  end
@@ -1,7 +1,8 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
3
  # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
4
+ # Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) }
5
5
 
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- # Rails.backtrace_cleaner.remove_silencers!
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code
7
+ # by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'".
8
+ Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"]