railties 6.0.3.6 → 6.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +228 -392
  3. data/MIT-LICENSE +1 -1
  4. data/RDOC_MAIN.rdoc +1 -1
  5. data/lib/minitest/rails_plugin.rb +16 -1
  6. data/lib/rails.rb +5 -8
  7. data/lib/rails/application.rb +49 -83
  8. data/lib/rails/application/bootstrap.rb +5 -5
  9. data/lib/rails/application/configuration.rb +52 -21
  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/backtrace_cleaner.rb +12 -7
  14. data/lib/rails/code_statistics.rb +3 -3
  15. data/lib/rails/code_statistics_calculator.rb +6 -6
  16. data/lib/rails/command.rb +7 -1
  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/commands/credentials/USAGE +17 -2
  21. data/lib/rails/commands/credentials/credentials_command.rb +28 -4
  22. data/lib/rails/commands/credentials/credentials_command/diffing.rb +41 -0
  23. data/lib/rails/commands/db/system/change/change_command.rb +6 -1
  24. data/lib/rails/commands/dbconsole/dbconsole_command.rb +59 -57
  25. data/lib/rails/commands/encrypted/encrypted_command.rb +4 -4
  26. data/lib/rails/commands/generate/generate_command.rb +1 -1
  27. data/lib/rails/commands/notes/notes_command.rb +1 -11
  28. data/lib/rails/commands/rake/rake_command.rb +9 -8
  29. data/lib/rails/commands/secrets/USAGE +9 -3
  30. data/lib/rails/commands/server/server_command.rb +14 -41
  31. data/lib/rails/commands/test/test_command.rb +2 -2
  32. data/lib/rails/configuration.rb +40 -10
  33. data/lib/rails/engine.rb +26 -15
  34. data/lib/rails/engine/configuration.rb +1 -0
  35. data/lib/rails/engine/updater.rb +1 -1
  36. data/lib/rails/gem_version.rb +3 -3
  37. data/lib/rails/generators.rb +29 -15
  38. data/lib/rails/generators/actions.rb +48 -27
  39. data/lib/rails/generators/actions/create_migration.rb +5 -0
  40. data/lib/rails/generators/app_base.rb +31 -16
  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 +2 -2
  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 +10 -10
  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 -4
  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 +2 -2
  56. data/lib/rails/generators/rails/app/templates/bin/rake.tt +2 -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 +7 -0
  59. data/lib/rails/generators/rails/app/templates/bin/yarn.tt +5 -7
  60. data/lib/rails/generators/rails/app/templates/config.ru.tt +2 -1
  61. data/lib/rails/generators/rails/app/templates/config/application.rb.tt +7 -3
  62. data/lib/rails/generators/rails/app/templates/config/boot.rb.tt +8 -2
  63. data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +3 -4
  64. data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +10 -9
  65. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +11 -10
  66. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +10 -9
  67. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +11 -10
  68. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +11 -10
  69. data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +10 -9
  70. data/lib/rails/generators/rails/app/templates/config/environment.rb.tt +1 -1
  71. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +17 -3
  72. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +14 -4
  73. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +12 -1
  74. data/lib/rails/generators/rails/app/templates/config/initializers/backtrace_silencers.rb.tt +4 -3
  75. data/lib/rails/generators/rails/app/templates/config/initializers/feature_policy.rb.tt +11 -0
  76. data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +3 -1
  77. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt +45 -0
  78. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +1 -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 +24 -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/info.rb +1 -1
  134. data/lib/rails/info_controller.rb +1 -1
  135. data/lib/rails/mailers_controller.rb +1 -0
  136. data/lib/rails/paths.rb +14 -6
  137. data/lib/rails/rack/logger.rb +1 -1
  138. data/lib/rails/railtie.rb +29 -3
  139. data/lib/rails/railtie/configuration.rb +3 -2
  140. data/lib/rails/source_annotation_extractor.rb +1 -15
  141. data/lib/rails/tasks.rb +0 -4
  142. data/lib/rails/tasks/engine.rake +1 -4
  143. data/lib/rails/tasks/framework.rake +7 -1
  144. data/lib/rails/tasks/misc.rake +1 -1
  145. data/lib/rails/tasks/statistics.rake +1 -1
  146. data/lib/rails/templates/rails/mailers/email.html.erb +1 -0
  147. data/lib/rails/templates/rails/welcome/index.html.erb +1 -1
  148. data/lib/rails/test_unit/reporter.rb +2 -1
  149. data/lib/rails/test_unit/runner.rb +20 -3
  150. data/lib/rails/test_unit/testing.rake +6 -0
  151. metadata +26 -32
  152. data/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml.tt +0 -50
  153. data/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml.tt +0 -86
  154. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_0.rb.tt +0 -45
  155. data/lib/rails/generators/rails/plugin/templates/rails/application.rb.tt +0 -23
  156. data/lib/rails/tasks/annotations.rake +0 -22
  157. data/lib/rails/tasks/dev.rake +0 -11
  158. data/lib/rails/tasks/initializers.rake +0 -9
  159. data/lib/rails/tasks/routes.rake +0 -9
@@ -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,17 +3,24 @@
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
+ Rails.start()
18
+ <%- unless options[:skip_turbolinks] -%>
19
+ Turbolinks.start()
20
+ <%- end -%>
21
+ <%- unless skip_active_storage? -%>
22
+ ActiveStorage.start()
23
+ <%- end -%>
17
24
 
18
25
  // Uncomment to copy all static images under ../images to the output folder and reference
19
26
  // them with the image_pack_tag helper in views (e.g <%%= image_pack_tag 'rails.png' %>)
@@ -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,3 @@
1
1
  APP_PATH = File.expand_path('../config/application', __dir__)
2
- require_relative '../config/boot'
3
- require 'rails/commands'
2
+ require_relative "../config/boot"
3
+ require "rails/commands"
@@ -1,3 +1,3 @@
1
- require_relative '../config/boot'
2
- require 'rake'
1
+ require_relative "../config/boot"
2
+ require "rake"
3
3
  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,7 @@
1
+ # Load Spring without loading other gems in the Gemfile, for speed.
2
+ require "bundler"
3
+ Bundler.locked_gems.specs.find { |spec| spec.name == "spring" }&.tap do |spring|
4
+ Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
5
+ gem "spring", spring.version
6
+ require "spring/binstub"
7
+ end
@@ -1,10 +1,8 @@
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
6
- $stderr.puts "Yarn executable was not detected in the system."
7
- $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
8
- exit 1
9
- end
3
+ exec "yarn", *ARGV
4
+ rescue Errno::ENOENT
5
+ $stderr.puts "Yarn executable was not detected in the system."
6
+ $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
7
+ exit 1
10
8
  end
@@ -1,5 +1,6 @@
1
1
  # This file is used by Rack-based servers to start the application.
2
2
 
3
- require_relative 'config/environment'
3
+ require_relative "config/environment"
4
4
 
5
5
  run Rails.application
6
+ Rails.application.load_server
@@ -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,8 +25,12 @@ 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
35
  # Settings in config/environments/* take precedence over those specified here.
32
36
  # Application configuration can go into files in config/initializers
@@ -1,6 +1,12 @@
1
1
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2
+ <% if spring_install? -%>
2
3
 
3
- require 'bundler/setup' # Set up gems listed in the Gemfile.
4
+ if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"])
5
+ load File.expand_path("../bin/spring", __dir__)
6
+ end
7
+ <% end -%>
8
+
9
+ require "bundler/setup" # Set up gems listed in the Gemfile.
4
10
  <% if depend_on_bootsnap? -%>
5
- require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
11
+ require "bootsnap/setup" # Speed up boot time by caching expensive operations.
6
12
  <%- 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