railties 5.2.8.1 → 6.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of railties might be problematic. Click here for more details.

Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +182 -223
  3. data/MIT-LICENSE +1 -1
  4. data/RDOC_MAIN.rdoc +35 -28
  5. data/README.rdoc +1 -1
  6. data/lib/minitest/rails_plugin.rb +6 -10
  7. data/lib/rails/all.rb +4 -0
  8. data/lib/rails/api/generator.rb +2 -1
  9. data/lib/rails/api/task.rb +16 -0
  10. data/lib/rails/app_loader.rb +1 -1
  11. data/lib/rails/app_updater.rb +3 -1
  12. data/lib/rails/application/configuration.rb +54 -12
  13. data/lib/rails/application/default_middleware_stack.rb +2 -0
  14. data/lib/rails/application.rb +21 -45
  15. data/lib/rails/backtrace_cleaner.rb +5 -17
  16. data/lib/rails/code_statistics.rb +3 -3
  17. data/lib/rails/command/actions.rb +0 -10
  18. data/lib/rails/command/base.rb +1 -5
  19. data/lib/rails/command/behavior.rb +4 -46
  20. data/lib/rails/command/environment_argument.rb +1 -11
  21. data/lib/rails/command/spellchecker.rb +58 -0
  22. data/lib/rails/command.rb +11 -10
  23. data/lib/rails/commands/credentials/USAGE +19 -1
  24. data/lib/rails/commands/credentials/credentials_command.rb +42 -23
  25. data/lib/rails/commands/db/system/change/change_command.rb +20 -0
  26. data/lib/rails/commands/dbconsole/dbconsole_command.rb +2 -2
  27. data/lib/rails/commands/dev/dev_command.rb +17 -0
  28. data/lib/rails/commands/encrypted/encrypted_command.rb +2 -3
  29. data/lib/rails/commands/help/help_command.rb +1 -1
  30. data/lib/rails/commands/initializers/initializers_command.rb +16 -0
  31. data/lib/rails/commands/new/new_command.rb +2 -2
  32. data/lib/rails/commands/notes/notes_command.rb +39 -0
  33. data/lib/rails/commands/plugin/plugin_command.rb +1 -1
  34. data/lib/rails/commands/routes/routes_command.rb +37 -0
  35. data/lib/rails/commands/runner/runner_command.rb +6 -6
  36. data/lib/rails/commands/secrets/USAGE +3 -3
  37. data/lib/rails/commands/secrets/secrets_command.rb +3 -3
  38. data/lib/rails/commands/server/server_command.rb +109 -48
  39. data/lib/rails/configuration.rb +1 -7
  40. data/lib/rails/engine/configuration.rb +3 -1
  41. data/lib/rails/engine.rb +3 -9
  42. data/lib/rails/gem_version.rb +4 -4
  43. data/lib/rails/generators/actions.rb +48 -37
  44. data/lib/rails/generators/app_base.rb +49 -89
  45. data/lib/rails/generators/app_name.rb +50 -0
  46. data/lib/rails/generators/base.rb +0 -4
  47. data/lib/rails/generators/database.rb +57 -0
  48. data/lib/rails/generators/erb/mailer/mailer_generator.rb +1 -1
  49. data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +1 -1
  50. data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +1 -1
  51. data/lib/rails/generators/generated_attribute.rb +17 -17
  52. data/lib/rails/generators/model_helpers.rb +8 -1
  53. data/lib/rails/generators/named_base.rb +1 -5
  54. data/lib/rails/generators/rails/app/app_generator.rb +37 -72
  55. data/lib/rails/generators/rails/app/templates/Gemfile.tt +3 -6
  56. data/lib/rails/generators/rails/app/templates/app/assets/config/manifest.js.tt +0 -3
  57. data/lib/rails/generators/rails/app/templates/app/{assets/javascripts/cable.js.tt → javascript/channels/consumer.js} +2 -9
  58. data/lib/rails/generators/rails/app/templates/app/javascript/channels/index.js +5 -0
  59. data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +15 -0
  60. data/lib/rails/generators/rails/app/templates/app/jobs/application_job.rb.tt +5 -0
  61. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +4 -4
  62. data/lib/rails/generators/rails/app/templates/bin/setup.tt +4 -5
  63. data/lib/rails/generators/rails/app/templates/bin/update.tt +6 -7
  64. data/lib/rails/generators/rails/app/templates/config/application.rb.tt +2 -0
  65. data/lib/rails/generators/rails/app/templates/config/cable.yml.tt +1 -1
  66. data/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml.tt +2 -2
  67. data/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml.tt +2 -2
  68. data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +2 -2
  69. data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +3 -3
  70. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +3 -3
  71. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +4 -4
  72. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +2 -2
  73. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +6 -6
  74. data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +2 -2
  75. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +3 -2
  76. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +5 -12
  77. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +6 -2
  78. data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +1 -1
  79. data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +4 -0
  80. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_0.rb.tt +33 -0
  81. data/lib/rails/generators/rails/app/templates/config/locales/en.yml +1 -1
  82. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +3 -5
  83. data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +1 -1
  84. data/lib/rails/generators/rails/app/templates/config/spring.rb.tt +6 -6
  85. data/lib/rails/generators/rails/app/templates/gitignore.tt +2 -7
  86. data/lib/rails/generators/rails/app/templates/package.json.tt +7 -1
  87. data/lib/rails/generators/rails/app/templates/ruby-version.tt +1 -1
  88. data/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt +11 -0
  89. data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +7 -0
  90. data/lib/rails/generators/rails/assets/USAGE +1 -4
  91. data/lib/rails/generators/rails/assets/assets_generator.rb +0 -8
  92. data/lib/rails/generators/rails/controller/controller_generator.rb +11 -1
  93. data/lib/rails/generators/rails/credentials/credentials_generator.rb +7 -8
  94. data/lib/rails/generators/rails/db/system/change/change_generator.rb +55 -0
  95. data/lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb +4 -5
  96. data/lib/rails/generators/rails/helper/helper_generator.rb +5 -0
  97. data/lib/rails/generators/rails/plugin/plugin_generator.rb +9 -18
  98. data/lib/rails/generators/rails/plugin/templates/app/controllers/%namespaced_name%/application_controller.rb.tt +1 -1
  99. data/lib/rails/generators/rails/plugin/templates/app/helpers/%namespaced_name%/application_helper.rb.tt +1 -1
  100. data/lib/rails/generators/rails/plugin/templates/app/jobs/%namespaced_name%/application_job.rb.tt +1 -1
  101. data/lib/rails/generators/rails/plugin/templates/app/mailers/%namespaced_name%/application_mailer.rb.tt +1 -1
  102. data/lib/rails/generators/rails/plugin/templates/app/models/%namespaced_name%/application_record.rb.tt +1 -1
  103. data/lib/rails/generators/rails/plugin/templates/gitignore.tt +1 -1
  104. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/engine.rb.tt +1 -1
  105. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/railtie.rb.tt +1 -1
  106. data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +1 -2
  107. data/lib/rails/generators/resource_helpers.rb +1 -6
  108. data/lib/rails/generators/test_unit/integration/integration_generator.rb +6 -0
  109. data/lib/rails/generators/test_unit/job/job_generator.rb +5 -0
  110. data/lib/rails/generators/test_unit/mailer/mailer_generator.rb +1 -1
  111. data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +1 -1
  112. data/lib/rails/generators/test_unit/system/system_generator.rb +5 -0
  113. data/lib/rails/generators/testing/behaviour.rb +3 -0
  114. data/lib/rails/generators.rb +11 -12
  115. data/lib/rails/info.rb +2 -2
  116. data/lib/rails/info_controller.rb +1 -1
  117. data/lib/rails/mailers_controller.rb +1 -1
  118. data/lib/rails/paths.rb +19 -9
  119. data/lib/rails/railtie.rb +1 -1
  120. data/lib/rails/ruby_version_check.rb +3 -3
  121. data/lib/rails/secrets.rb +0 -1
  122. data/lib/rails/source_annotation_extractor.rb +125 -117
  123. data/lib/rails/tasks/annotations.rake +9 -9
  124. data/lib/rails/tasks/dev.rake +5 -4
  125. data/lib/rails/tasks/framework.rake +5 -1
  126. data/lib/rails/tasks/initializers.rake +5 -4
  127. data/lib/rails/tasks/log.rake +0 -1
  128. data/lib/rails/tasks/routes.rake +4 -26
  129. data/lib/rails/tasks/statistics.rake +1 -0
  130. data/lib/rails/tasks/yarn.rake +1 -1
  131. data/lib/rails/templates/rails/welcome/index.html.erb +2 -2
  132. data/lib/rails/test_help.rb +11 -9
  133. data/lib/rails/test_unit/reporter.rb +1 -1
  134. data/lib/rails/test_unit/runner.rb +5 -5
  135. data/lib/rails/test_unit/testing.rake +1 -1
  136. metadata +33 -27
  137. data/lib/rails/commands/encrypted/USAGE +0 -28
  138. data/lib/rails/generators/js/assets/assets_generator.rb +0 -15
  139. data/lib/rails/generators/js/assets/templates/javascript.js +0 -2
  140. data/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt +0 -22
  141. data/lib/rails/generators/rails/app/templates/bin/bundle.tt +0 -2
  142. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_5_2.rb.tt +0 -38
  143. data/lib/rails/generators/rails/assets/templates/javascript.js +0 -2
@@ -21,7 +21,6 @@ module Rails
21
21
  RUBY
22
22
  end
23
23
 
24
- # TODO: Remove once this is fully in place
25
24
  def method_missing(meth, *args, &block)
26
25
  @generator.send(meth, *args, &block)
27
26
  end
@@ -81,7 +80,6 @@ module Rails
81
80
  directory "app"
82
81
 
83
82
  keep_file "app/assets/images"
84
- empty_directory_with_keep_file "app/assets/javascripts/channels" unless options[:skip_action_cable]
85
83
 
86
84
  keep_file "app/controllers/concerns"
87
85
  keep_file "app/models/concerns"
@@ -95,11 +93,9 @@ module Rails
95
93
  end
96
94
 
97
95
  def bin_when_updating
98
- bin_yarn_exist = File.exist?("bin/yarn")
99
-
100
96
  bin
101
97
 
102
- if options[:api] && !bin_yarn_exist
98
+ if options[:skip_javascript]
103
99
  remove_file "bin/yarn"
104
100
  end
105
101
  end
@@ -159,10 +155,6 @@ module Rails
159
155
  remove_file "config/initializers/cookies_serializer.rb"
160
156
  end
161
157
 
162
- unless assets_config_exist
163
- remove_file "config/initializers/assets.rb"
164
- end
165
-
166
158
  unless csp_config_exist
167
159
  remove_file "config/initializers/content_security_policy.rb"
168
160
  end
@@ -221,6 +213,7 @@ module Rails
221
213
  empty_directory_with_keep_file "test/helpers"
222
214
  empty_directory_with_keep_file "test/integration"
223
215
 
216
+ template "test/channels/application_cable/connection_test.rb"
224
217
  template "test/test_helper.rb"
225
218
  end
226
219
 
@@ -232,7 +225,6 @@ module Rails
232
225
 
233
226
  def tmp
234
227
  empty_directory_with_keep_file "tmp"
235
- empty_directory_with_keep_file "tmp/pids"
236
228
  empty_directory "tmp/cache"
237
229
  empty_directory "tmp/cache/assets"
238
230
  end
@@ -250,14 +242,13 @@ module Rails
250
242
  # We need to store the RAILS_DEV_PATH in a constant, otherwise the path
251
243
  # can change in Ruby 1.8.7 when we FileUtils.cd.
252
244
  RAILS_DEV_PATH = File.expand_path("../../../../../..", __dir__)
253
- RESERVED_NAMES = %w[application destroy plugin runner test]
254
245
 
255
246
  class AppGenerator < AppBase # :nodoc:
256
247
  WEBPACKS = %w( react vue angular elm stimulus )
257
248
 
258
249
  add_shared_options_for "application"
259
250
 
260
- # Add bin/rails options
251
+ # Add rails command options
261
252
  class_option :version, type: :boolean, aliases: "-v", group: :rails,
262
253
  desc: "Show Rails version number and quit"
263
254
 
@@ -267,21 +258,26 @@ module Rails
267
258
  class_option :skip_bundle, type: :boolean, aliases: "-B", default: false,
268
259
  desc: "Don't run bundle install"
269
260
 
270
- class_option :webpack, type: :string, default: nil,
271
- desc: "Preconfigure for app-like JavaScript with Webpack (options: #{WEBPACKS.join('/')})"
261
+ class_option :webpack, type: :string, aliases: "--webpacker", default: nil,
262
+ desc: "Preconfigure Webpack with a particular framework (options: #{WEBPACKS.join(", ")})"
263
+
264
+ class_option :skip_webpack_install, type: :boolean, default: false,
265
+ desc: "Don't run Webpack install"
272
266
 
273
267
  def initialize(*args)
274
268
  super
275
269
 
276
270
  if !options[:skip_active_record] && !DATABASES.include?(options[:database])
277
- raise Error, "Invalid value for --database option. Supported for preconfiguration are: #{DATABASES.join(", ")}."
271
+ raise Error, "Invalid value for --database option. Supported preconfigurations are: #{DATABASES.join(", ")}."
278
272
  end
279
273
 
280
274
  # Force sprockets and yarn to be skipped when generating API only apps.
281
275
  # Can't modify options hash as it's frozen by default.
282
276
  if options[:api]
283
- self.options = options.merge(skip_sprockets: true, skip_javascript: true, skip_yarn: true).freeze
277
+ self.options = options.merge(skip_sprockets: true, skip_javascript: true).freeze
284
278
  end
279
+
280
+ @after_bundle_callbacks = []
285
281
  end
286
282
 
287
283
  public_task :set_default_accessors!
@@ -295,7 +291,7 @@ module Rails
295
291
  build(:gitignore) unless options[:skip_git]
296
292
  build(:gemfile) unless options[:skip_gemfile]
297
293
  build(:version_control)
298
- build(:package_json) unless options[:skip_yarn]
294
+ build(:package_json) unless options[:skip_javascript]
299
295
  end
300
296
 
301
297
  def create_app_files
@@ -311,6 +307,13 @@ module Rails
311
307
  end
312
308
  remove_task :update_bin_files
313
309
 
310
+ def update_active_storage
311
+ unless skip_active_storage?
312
+ rails_command "active_storage:update"
313
+ end
314
+ end
315
+ remove_task :update_active_storage
316
+
314
317
  def create_config_files
315
318
  build(:config)
316
319
  end
@@ -329,7 +332,7 @@ module Rails
329
332
  end
330
333
 
331
334
  def display_upgrade_guide_info
332
- say "\nAfter this, check Rails upgrade guide at http://guides.rubyonrails.org/upgrading_ruby_on_rails.html for more details about upgrading your app."
335
+ say "\nAfter this, check Rails upgrade guide at https://guides.rubyonrails.org/upgrading_ruby_on_rails.html for more details about upgrading your app."
333
336
  end
334
337
  remove_task :display_upgrade_guide_info
335
338
 
@@ -417,7 +420,7 @@ module Rails
417
420
 
418
421
  def delete_js_folder_skipping_javascript
419
422
  if options[:skip_javascript]
420
- remove_dir "app/assets/javascripts"
423
+ remove_dir "app/javascript"
421
424
  end
422
425
  end
423
426
 
@@ -444,8 +447,9 @@ module Rails
444
447
 
445
448
  def delete_action_cable_files_skipping_action_cable
446
449
  if options[:skip_action_cable]
447
- remove_file "app/assets/javascripts/cable.js"
450
+ remove_dir "app/javascript/channels"
448
451
  remove_dir "app/channels"
452
+ remove_dir "test/channels"
449
453
  end
450
454
  end
451
455
 
@@ -464,12 +468,12 @@ module Rails
464
468
 
465
469
  def delete_new_framework_defaults
466
470
  unless options[:update]
467
- remove_file "config/initializers/new_framework_defaults_5_2.rb"
471
+ remove_file "config/initializers/new_framework_defaults_6_0.rb"
468
472
  end
469
473
  end
470
474
 
471
- def delete_bin_yarn_if_skip_yarn_option
472
- remove_file "bin/yarn" if options[:skip_yarn]
475
+ def delete_bin_yarn
476
+ remove_file "bin/yarn" if options[:skip_javascript]
473
477
  end
474
478
 
475
479
  def finish_template
@@ -477,7 +481,8 @@ module Rails
477
481
  end
478
482
 
479
483
  public_task :apply_rails_template, :run_bundle
480
- public_task :run_webpack, :generate_spring_binstubs
484
+ public_task :generate_bundler_binstub, :generate_spring_binstubs
485
+ public_task :run_webpack
481
486
 
482
487
  def run_after_bundle_callbacks
483
488
  @after_bundle_callbacks.each(&:call)
@@ -494,54 +499,14 @@ module Rails
494
499
  create_file(*args, &block)
495
500
  end
496
501
 
497
- def app_name
498
- @app_name ||= (defined_app_const_base? ? defined_app_name : File.basename(destination_root)).tr('\\', "").tr(". ", "_")
499
- end
500
-
501
- def defined_app_name
502
- defined_app_const_base.underscore
503
- end
504
-
505
- def defined_app_const_base
506
- Rails.respond_to?(:application) && defined?(Rails::Application) &&
507
- Rails.application.is_a?(Rails::Application) && Rails.application.class.name.sub(/::Application$/, "")
508
- end
509
-
510
- alias :defined_app_const_base? :defined_app_const_base
511
-
512
- def app_const_base
513
- @app_const_base ||= defined_app_const_base || app_name.gsub(/\W/, "_").squeeze("_").camelize
514
- end
515
- alias :camelized :app_const_base
516
-
517
- def app_const
518
- @app_const ||= "#{app_const_base}::Application"
519
- end
520
-
521
- def valid_const?
522
- if app_const =~ /^\d/
523
- raise Error, "Invalid application name #{app_name}. Please give a name which does not start with numbers."
524
- elsif RESERVED_NAMES.include?(app_name)
525
- raise Error, "Invalid application name #{app_name}. Please give a " \
526
- "name which does not match one of the reserved rails " \
527
- "words: #{RESERVED_NAMES.join(", ")}"
528
- elsif Object.const_defined?(app_const_base)
529
- raise Error, "Invalid application name #{app_name}, constant #{app_const_base} is already in use. Please choose another application name."
530
- end
531
- end
532
-
533
- def mysql_socket
534
- @mysql_socket ||= [
535
- "/tmp/mysql.sock", # default
536
- "/var/run/mysqld/mysqld.sock", # debian/gentoo
537
- "/var/tmp/mysql.sock", # freebsd
538
- "/var/lib/mysql/mysql.sock", # fedora
539
- "/opt/local/lib/mysql/mysql.sock", # fedora
540
- "/opt/local/var/run/mysqld/mysqld.sock", # mac + darwinports + mysql
541
- "/opt/local/var/run/mysql4/mysqld.sock", # mac + darwinports + mysql4
542
- "/opt/local/var/run/mysql5/mysqld.sock", # mac + darwinports + mysql5
543
- "/opt/lampp/var/mysql/mysql.sock" # xampp for linux
544
- ].find { |f| File.exist?(f) } unless Gem.win_platform?
502
+ # Registers a callback to be executed after bundle and spring binstubs
503
+ # have run.
504
+ #
505
+ # after_bundle do
506
+ # git add: '.'
507
+ # end
508
+ def after_bundle(&block) # :doc:
509
+ @after_bundle_callbacks << block
545
510
  end
546
511
 
547
512
  def get_builder_class
@@ -18,17 +18,14 @@ ruby <%= "'#{RUBY_VERSION}'" -%>
18
18
  <% end -%>
19
19
  <% end -%>
20
20
 
21
- # Use ActiveModel has_secure_password
21
+ # Use Active Model has_secure_password
22
22
  # gem 'bcrypt', '~> 3.1.7'
23
23
  <% unless skip_active_storage? -%>
24
24
 
25
- # Use ActiveStorage variant
26
- # gem 'mini_magick', '~> 4.8'
25
+ # Use Active Storage variant
26
+ # gem 'image_processing', '~> 1.2'
27
27
  <% end -%>
28
28
 
29
- # Use Capistrano for deployment
30
- # gem 'capistrano-rails', group: :development
31
-
32
29
  <% if depend_on_bootsnap? -%>
33
30
  # Reduces boot times through caching; required in config/boot.rb
34
31
  gem 'bootsnap', '>= 1.1.0', require: false
@@ -1,5 +1,2 @@
1
1
  //= link_tree ../images
2
- <% unless options.skip_javascript -%>
3
- //= link_directory ../javascripts .js
4
- <% end -%>
5
2
  //= link_directory ../stylesheets .css
@@ -1,13 +1,6 @@
1
1
  // Action Cable provides the framework to deal with WebSockets in Rails.
2
2
  // You can generate new channels where WebSocket features live using the `rails generate channel` command.
3
- //
4
- //= require action_cable
5
- //= require_self
6
- //= require_tree ./channels
7
3
 
8
- (function() {
9
- this.App || (this.App = {});
4
+ import { createConsumer } from "@rails/actioncable"
10
5
 
11
- App.cable = ActionCable.createConsumer();
12
-
13
- }).call(this);
6
+ export default createConsumer()
@@ -0,0 +1,5 @@
1
+ // Load all the channels within this directory and all subdirectories.
2
+ // Channel files must be named *_channel.js.
3
+
4
+ const channels = require.context('.', true, /_channel\.js$/)
5
+ channels.keys().forEach(channels)
@@ -0,0 +1,15 @@
1
+ // This file is automatically compiled by Webpack, along with any other files
2
+ // present in this directory. You're encouraged to place your actual application logic in
3
+ // a relevant structure within app/javascript and only use these pack files to reference
4
+ // that code so it'll be compiled.
5
+
6
+ require("@rails/ujs").start()
7
+ <%- unless options[:skip_turbolinks] -%>
8
+ require("turbolinks").start()
9
+ <%- end -%>
10
+ <%- unless skip_active_storage? -%>
11
+ require("@rails/activestorage").start()
12
+ <%- end -%>
13
+ <%- unless options[:skip_action_cable] -%>
14
+ require("channels")
15
+ <%- end -%>
@@ -1,2 +1,7 @@
1
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
2
7
  end
@@ -9,11 +9,11 @@
9
9
  <%%= stylesheet_link_tag 'application', media: 'all' %>
10
10
  <%- else -%>
11
11
  <%- unless options[:skip_turbolinks] -%>
12
- <%%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
13
- <%%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
12
+ <%%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
13
+ <%%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
14
14
  <%- else -%>
15
- <%%= stylesheet_link_tag 'application', media: 'all' %>
16
- <%%= javascript_include_tag 'application' %>
15
+ <%%= stylesheet_link_tag 'application', media: 'all' %>
16
+ <%%= javascript_pack_tag 'application' %>
17
17
  <%- end -%>
18
18
  <%- end -%>
19
19
  </head>
@@ -1,5 +1,4 @@
1
1
  require 'fileutils'
2
- include FileUtils
3
2
 
4
3
  # path to your application root.
5
4
  APP_ROOT = File.expand_path('..', __dir__)
@@ -8,23 +7,23 @@ def system!(*args)
8
7
  system(*args) || abort("\n== Command #{args} failed ==")
9
8
  end
10
9
 
11
- chdir APP_ROOT do
10
+ FileUtils.chdir APP_ROOT do
12
11
  # This script is a starting point to setup your application.
13
12
  # Add necessary setup steps to this file.
14
13
 
15
14
  puts '== Installing dependencies =='
16
15
  system! 'gem install bundler --conservative'
17
16
  system('bundle check') || system!('bundle install')
18
- <% unless options.skip_yarn? -%>
17
+ <% unless options.skip_javascript? -%>
19
18
 
20
- # Install JavaScript dependencies if using Yarn
19
+ # Install JavaScript dependencies
21
20
  # system('bin/yarn')
22
21
  <% end -%>
23
22
  <% unless options.skip_active_record? -%>
24
23
 
25
24
  # puts "\n== Copying sample files =="
26
25
  # unless File.exist?('config/database.yml')
27
- # cp 'config/database.yml.sample', 'config/database.yml'
26
+ # FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
28
27
  # end
29
28
 
30
29
  puts "\n== Preparing database =="
@@ -1,5 +1,4 @@
1
1
  require 'fileutils'
2
- include FileUtils
3
2
 
4
3
  # path to your application root.
5
4
  APP_ROOT = File.expand_path('..', __dir__)
@@ -8,27 +7,27 @@ def system!(*args)
8
7
  system(*args) || abort("\n== Command #{args} failed ==")
9
8
  end
10
9
 
11
- chdir APP_ROOT do
10
+ FileUtils.chdir APP_ROOT do
12
11
  # This script is a way to update your development environment automatically.
13
12
  # Add necessary update steps to this file.
14
13
 
15
14
  puts '== Installing dependencies =='
16
15
  system! 'gem install bundler --conservative'
17
16
  system('bundle check') || system!('bundle install')
18
- <% unless options.skip_yarn? -%>
17
+ <% unless options.skip_javascript? -%>
19
18
 
20
- # Install JavaScript dependencies if using Yarn
19
+ # Install JavaScript dependencies
21
20
  # system('bin/yarn')
22
21
  <% end -%>
23
22
  <% unless options.skip_active_record? -%>
24
23
 
25
24
  puts "\n== Updating database =="
26
- system! 'bin/rails db:migrate'
25
+ system! 'rails db:migrate'
27
26
  <% end -%>
28
27
 
29
28
  puts "\n== Removing old logs and tempfiles =="
30
- system! 'bin/rails log:clear tmp:clear'
29
+ system! 'rails log:clear tmp:clear'
31
30
 
32
31
  puts "\n== Restarting application server =="
33
- system! 'bin/rails restart'
32
+ system! 'rails restart'
34
33
  end
@@ -11,6 +11,8 @@ require "active_job/railtie"
11
11
  <%= comment_if :skip_active_storage %>require "active_storage/engine"
12
12
  require "action_controller/railtie"
13
13
  <%= comment_if :skip_action_mailer %>require "action_mailer/railtie"
14
+ <%= comment_if :skip_action_mailbox %>require "action_mailbox/engine"
15
+ <%= comment_if :skip_action_text %>require "action_text/engine"
14
16
  require "action_view/railtie"
15
17
  <%= comment_if :skip_action_cable %>require "action_cable/engine"
16
18
  <%= comment_if :skip_sprockets %>require "sprockets/railtie"
@@ -2,7 +2,7 @@ development:
2
2
  adapter: async
3
3
 
4
4
  test:
5
- adapter: async
5
+ adapter: test
6
6
 
7
7
  production:
8
8
  adapter: redis
@@ -24,12 +24,12 @@ test:
24
24
  <<: *default
25
25
  database: <%= app_name %>_test
26
26
 
27
- # As with config/secrets.yml, you never want to store sensitive information,
27
+ # As with config/credentials.yml, you never want to store sensitive information,
28
28
  # like your database password, in your source code. If your source code is
29
29
  # ever seen by anyone, they now have access to your database.
30
30
  #
31
31
  # Instead, provide the password as a unix environment variable when you boot
32
- # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
32
+ # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
33
33
  # for a full rundown on how to provide these environment variables in a
34
34
  # production deployment.
35
35
  #
@@ -60,12 +60,12 @@ test:
60
60
  <<: *default
61
61
  database: <%= app_name[0,4] %>_tst
62
62
 
63
- # As with config/secrets.yml, you never want to store sensitive information,
63
+ # As with config/credentials.yml, you never want to store sensitive information,
64
64
  # like your database password, in your source code. If your source code is
65
65
  # ever seen by anyone, they now have access to your database.
66
66
  #
67
67
  # Instead, provide the password as a unix environment variable when you boot
68
- # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
68
+ # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
69
69
  # for a full rundown on how to provide these environment variables in a
70
70
  # production deployment.
71
71
  #
@@ -54,12 +54,12 @@ test:
54
54
  <<: *default
55
55
  url: jdbc:db://localhost/<%= app_name %>_test
56
56
 
57
- # As with config/secrets.yml, you never want to store sensitive information,
57
+ # As with config/credentials.yml, you never want to store sensitive information,
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
61
  # Instead, provide the password as a unix environment variable when you boot
62
- # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
62
+ # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
63
63
  # for a full rundown on how to provide these environment variables in a
64
64
  # production deployment.
65
65
  #
@@ -1,4 +1,4 @@
1
- # MySQL. Versions 5.1.10 and up are supported.
1
+ # MySQL. Versions 5.5.8 and up are supported.
2
2
  #
3
3
  # Install the MySQL driver:
4
4
  # gem install activerecord-jdbcmysql-adapter
@@ -27,12 +27,12 @@ test:
27
27
  <<: *default
28
28
  database: <%= app_name %>_test
29
29
 
30
- # As with config/secrets.yml, you never want to store sensitive information,
30
+ # As with config/credentials.yml, you never want to store sensitive information,
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
34
  # Instead, provide the password as a unix environment variable when you boot
35
- # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
35
+ # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
36
36
  # for a full rundown on how to provide these environment variables in a
37
37
  # production deployment.
38
38
  #
@@ -1,4 +1,4 @@
1
- # PostgreSQL. Versions 9.1 and up are supported.
1
+ # PostgreSQL. Versions 9.3 and up are supported.
2
2
  #
3
3
  # Configure Using Gemfile
4
4
  # gem 'activerecord-jdbcpostgresql-adapter'
@@ -43,12 +43,12 @@ test:
43
43
  <<: *default
44
44
  database: <%= app_name %>_test
45
45
 
46
- # As with config/secrets.yml, you never want to store sensitive information,
46
+ # As with config/credentials.yml, you never want to store sensitive information,
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
50
  # Instead, provide the password as a unix environment variable when you boot
51
- # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
51
+ # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
52
52
  # for a full rundown on how to provide these environment variables in a
53
53
  # production deployment.
54
54
  #
@@ -1,4 +1,4 @@
1
- # MySQL. Versions 5.1.10 and up are supported.
1
+ # MySQL. Versions 5.5.8 and up are supported.
2
2
  #
3
3
  # Install the MySQL driver
4
4
  # gem install mysql2
@@ -11,7 +11,7 @@
11
11
  #
12
12
  default: &default
13
13
  adapter: mysql2
14
- encoding: utf8
14
+ encoding: utf8mb4
15
15
  pool: <%%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
16
16
  username: root
17
17
  password:
@@ -32,12 +32,12 @@ test:
32
32
  <<: *default
33
33
  database: <%= app_name %>_test
34
34
 
35
- # As with config/secrets.yml, you never want to store sensitive information,
35
+ # As with config/credentials.yml, you never want to store sensitive information,
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
39
  # Instead, provide the password as a unix environment variable when you boot
40
- # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
40
+ # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
41
41
  # for a full rundown on how to provide these environment variables in a
42
42
  # production deployment.
43
43
  #
@@ -33,12 +33,12 @@ test:
33
33
  <<: *default
34
34
  database: <%= app_name %>_test
35
35
 
36
- # As with config/secrets.yml, you never want to store sensitive information,
36
+ # As with config/credentials.yml, you never want to store sensitive information,
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
40
  # Instead, provide the password as a unix environment variable when you boot
41
- # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
41
+ # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
42
42
  # for a full rundown on how to provide these environment variables in a
43
43
  # production deployment.
44
44
  #
@@ -1,10 +1,10 @@
1
- # PostgreSQL. Versions 9.1 and up are supported.
1
+ # PostgreSQL. Versions 9.3 and up are supported.
2
2
  #
3
3
  # Install the pg driver:
4
4
  # gem install pg
5
- # On OS X with Homebrew:
5
+ # On macOS with Homebrew:
6
6
  # gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7
- # On OS X with MacPorts:
7
+ # On macOS with MacPorts:
8
8
  # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
9
9
  # On Windows:
10
10
  # gem install pg
@@ -18,7 +18,7 @@ default: &default
18
18
  adapter: postgresql
19
19
  encoding: unicode
20
20
  # For details on connection pooling, see Rails configuration guide
21
- # http://guides.rubyonrails.org/configuring.html#database-pooling
21
+ # https://guides.rubyonrails.org/configuring.html#database-pooling
22
22
  pool: <%%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
23
23
 
24
24
  development:
@@ -59,12 +59,12 @@ test:
59
59
  <<: *default
60
60
  database: <%= app_name %>_test
61
61
 
62
- # As with config/secrets.yml, you never want to store sensitive information,
62
+ # As with config/credentials.yml, you never want to store sensitive information,
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
66
  # Instead, provide the password as a unix environment variable when you boot
67
- # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
67
+ # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
68
68
  # for a full rundown on how to provide these environment variables in a
69
69
  # production deployment.
70
70
  #
@@ -26,12 +26,12 @@ test:
26
26
  <<: *default
27
27
  database: <%= app_name %>_test
28
28
 
29
- # As with config/secrets.yml, you never want to store sensitive information,
29
+ # As with config/credentials.yml, you never want to store sensitive information,
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
33
  # Instead, provide the password as a unix environment variable when you boot
34
- # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
34
+ # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
35
35
  # for a full rundown on how to provide these environment variables in a
36
36
  # production deployment.
37
37
  #
@@ -16,6 +16,7 @@ Rails.application.configure do
16
16
  # Run rails dev:cache to toggle caching.
17
17
  if Rails.root.join('tmp', 'caching-dev.txt').exist?
18
18
  config.action_controller.perform_caching = true
19
+ config.action_controller.enable_fragment_cache_logging = true
19
20
 
20
21
  config.cache_store = :memory_store
21
22
  config.public_file_server.headers = {
@@ -28,7 +29,7 @@ Rails.application.configure do
28
29
  end
29
30
  <%- unless skip_active_storage? -%>
30
31
 
31
- # Store uploaded files on the local file system (see config/storage.yml for options)
32
+ # Store uploaded files on the local file system (see config/storage.yml for options).
32
33
  config.active_storage.service = :local
33
34
  <%- end -%>
34
35
  <%- unless options.skip_action_mailer? -%>
@@ -60,7 +61,7 @@ Rails.application.configure do
60
61
  config.assets.quiet = true
61
62
  <%- end -%>
62
63
 
63
- # Raises error for missing translations
64
+ # Raises error for missing translations.
64
65
  # config.action_view.raise_on_missing_translations = true
65
66
 
66
67
  # Use an evented file watcher to asynchronously detect changes in source code,