railties 6.1.0.rc1 → 6.1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -1
  3. data/README.rdoc +1 -1
  4. data/lib/rails/api/task.rb +1 -1
  5. data/lib/rails/application.rb +2 -2
  6. data/lib/rails/application/configuration.rb +23 -4
  7. data/lib/rails/application/default_middleware_stack.rb +1 -1
  8. data/lib/rails/commands/dbconsole/dbconsole_command.rb +5 -4
  9. data/lib/rails/commands/notes/notes_command.rb +2 -2
  10. data/lib/rails/engine.rb +11 -19
  11. data/lib/rails/gem_version.rb +2 -2
  12. data/lib/rails/generators/actions.rb +2 -2
  13. data/lib/rails/generators/app_base.rb +13 -11
  14. data/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +1 -1
  15. data/lib/rails/generators/rails/app/app_generator.rb +4 -4
  16. data/lib/rails/generators/rails/app/templates/Gemfile.tt +2 -2
  17. data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +0 -7
  18. data/lib/rails/generators/rails/app/templates/bin/rails.tt +3 -0
  19. data/lib/rails/generators/rails/app/templates/bin/rake.tt +3 -0
  20. data/lib/rails/generators/rails/app/templates/bin/spring.tt +12 -6
  21. data/lib/rails/generators/rails/app/templates/bin/yarn.tt +13 -5
  22. data/lib/rails/generators/rails/app/templates/config/application.rb.tt +7 -4
  23. data/lib/rails/generators/rails/app/templates/config/boot.rb.tt +0 -6
  24. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +1 -1
  25. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt +22 -0
  26. data/lib/rails/generators/rails/app/templates/config/initializers/{feature_policy.rb.tt → permissions_policy.rb.tt} +2 -2
  27. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +5 -0
  28. data/lib/rails/generators/rails/plugin/plugin_generator.rb +1 -0
  29. data/lib/rails/railtie.rb +7 -11
  30. data/lib/rails/tasks/yarn.rake +14 -2
  31. metadata +15 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2595ee6688e528cbbec1fda2c452ea6f01feb32cba77637b08c0a0e9d129417f
4
- data.tar.gz: 4627bd3fcaa42fd513f624c07f28114fb2e4a40afa1a88ed374399e2bb437816
3
+ metadata.gz: 339e6a52c89070a2b91b474c6f43755163c7057cb4593d6f379c8f5c963ae260
4
+ data.tar.gz: 0136fc6b6f1339ff46128e050109d685e8a495c07659e3fd99b619f2a6145331
5
5
  SHA512:
6
- metadata.gz: 140d528eec6c89426b4fad98ad9aafb14918d51965cba10101ad3915e691aaa1230495043abf6d151a74a6adbd2dcfc5bb9e4fab9b30e56f09c6eef67ddf331d
7
- data.tar.gz: e26621507b14abdbcbaff311c4126b171c856a350c63f3ac69f2816dc475adb69df79299146cae0339e7802e740fede090cc3914e4f52a2b0779e192e4dccd02
6
+ metadata.gz: 43f0006109cf8879cbca3c630a0192e5db7a43c7e39f8137e0a0a1429ae7b4f0c9046f79f2c7fd5388ac1e564bf58665d3b5bea9175cb62dfd065b44152c407e
7
+ data.tar.gz: f31fc0acd29058689ec4a1b8e3281b2a4d2409522988b941624628455ac7573c263af7ec7661366e5500cc2ddef41d4f20d9049fc15ec41f40c7ca8dc843bc8e
data/CHANGELOG.md CHANGED
@@ -1,4 +1,27 @@
1
- ## Rails 6.1.0.rc1 (November 02, 2020) ##
1
+ ## Rails 6.1.2.1 (February 10, 2021) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 6.1.2 (February 09, 2021) ##
7
+
8
+ * No changes.
9
+
10
+
11
+ ## Rails 6.1.1 (January 07, 2021) ##
12
+
13
+ * Allow spaces in path to Yarn binstub and only run on precompile if needed.
14
+
15
+ *Markus Doits*
16
+
17
+ * Populate ARGV for app template.
18
+
19
+ Fixes #40945.
20
+
21
+ *Jonathan Hefner*
22
+
23
+
24
+ ## Rails 6.1.0 (December 09, 2020) ##
2
25
 
3
26
  * Added `Railtie#server` hook called when Rails starts a server.
4
27
  This is useful in case your application or a library needs to run
data/README.rdoc CHANGED
@@ -17,7 +17,7 @@ The latest version of Railties can be installed with RubyGems:
17
17
 
18
18
  Source code can be downloaded as part of the Rails project on GitHub
19
19
 
20
- * https://github.com/rails/rails/tree/master/railties
20
+ * https://github.com/rails/rails/tree/main/railties
21
21
 
22
22
  == License
23
23
 
@@ -189,7 +189,7 @@ module Rails
189
189
 
190
190
  class EdgeTask < RepoTask
191
191
  def rails_version
192
- "master@#{`git rev-parse HEAD`[0, 7]}"
192
+ "main@#{`git rev-parse HEAD`[0, 7]}"
193
193
  end
194
194
  end
195
195
 
@@ -243,7 +243,7 @@ module Rails
243
243
 
244
244
  if yaml.exist?
245
245
  require "erb"
246
- all_configs = ActiveSupport::ConfigurationFile.parse(yaml, symbolize_names: true)
246
+ all_configs = ActiveSupport::ConfigurationFile.parse(yaml).deep_symbolize_keys
247
247
  config, shared = all_configs[env.to_sym], all_configs[:shared]
248
248
 
249
249
  if config.is_a?(Hash)
@@ -286,7 +286,7 @@ module Rails
286
286
  "action_dispatch.content_security_policy_report_only" => config.content_security_policy_report_only,
287
287
  "action_dispatch.content_security_policy_nonce_generator" => config.content_security_policy_nonce_generator,
288
288
  "action_dispatch.content_security_policy_nonce_directives" => config.content_security_policy_nonce_directives,
289
- "action_dispatch.feature_policy" => config.feature_policy,
289
+ "action_dispatch.permissions_policy" => config.permissions_policy,
290
290
  )
291
291
  end
292
292
  end
@@ -73,7 +73,7 @@ module Rails
73
73
  @autoloader = :classic
74
74
  @disable_sandbox = false
75
75
  @add_autoload_paths_to_load_path = true
76
- @feature_policy = nil
76
+ @permissions_policy = nil
77
77
  @rake_eager_load = false
78
78
  end
79
79
 
@@ -181,6 +181,25 @@ module Rails
181
181
  action_controller.urlsafe_csrf_tokens = true
182
182
  end
183
183
 
184
+ if respond_to?(:action_view)
185
+ action_view.form_with_generates_remote_forms = false
186
+ action_view.preload_links_header = true
187
+ end
188
+
189
+ if respond_to?(:active_storage)
190
+ active_storage.queues.analysis = nil
191
+ active_storage.queues.purge = nil
192
+ end
193
+
194
+ if respond_to?(:action_mailbox)
195
+ action_mailbox.queues.incineration = nil
196
+ action_mailbox.queues.routing = nil
197
+ end
198
+
199
+ if respond_to?(:action_mailer)
200
+ action_mailer.deliver_later_queue_name = nil
201
+ end
202
+
184
203
  ActiveSupport.utc_to_local_returns_utc_offset_times = true
185
204
  else
186
205
  raise "Unknown version #{target_version.to_s.inspect}"
@@ -325,11 +344,11 @@ module Rails
325
344
  end
326
345
  end
327
346
 
328
- def feature_policy(&block)
347
+ def permissions_policy(&block)
329
348
  if block_given?
330
- @feature_policy = ActionDispatch::FeaturePolicy.new(&block)
349
+ @permissions_policy = ActionDispatch::PermissionsPolicy.new(&block)
331
350
  else
332
- @feature_policy
351
+ @permissions_policy
333
352
  end
334
353
  end
335
354
 
@@ -69,7 +69,7 @@ module Rails
69
69
 
70
70
  unless config.api_only
71
71
  middleware.use ::ActionDispatch::ContentSecurityPolicy::Middleware
72
- middleware.use ::ActionDispatch::FeaturePolicy::Middleware
72
+ middleware.use ::ActionDispatch::PermissionsPolicy::Middleware
73
73
  end
74
74
 
75
75
  middleware.use ::Rack::Head
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "active_support/core_ext/string/filters"
4
+ require "active_support/deprecation"
4
5
  require "rails/command/environment_argument"
5
6
 
6
7
  module Rails
@@ -72,17 +73,17 @@ module Rails
72
73
  when "sqlserver"
73
74
  args = []
74
75
 
75
- args += ["-D", "#{db_config.database}"] if db_config.database
76
+ args += ["-d", "#{db_config.database}"] if db_config.database
76
77
  args += ["-U", "#{config[:username]}"] if config[:username]
77
78
  args += ["-P", "#{config[:password]}"] if config[:password]
78
79
 
79
80
  if config[:host]
80
- host_arg = +"#{config[:host]}"
81
- host_arg << ":#{config[:port]}" if config[:port]
81
+ host_arg = +"tcp:#{config[:host]}"
82
+ host_arg << ",#{config[:port]}" if config[:port]
82
83
  args += ["-S", host_arg]
83
84
  end
84
85
 
85
- find_cmd_and_exec("sqsh", *args)
86
+ find_cmd_and_exec("sqlcmd", *args)
86
87
 
87
88
  else
88
89
  abort "Unknown command-line client for #{db_config.database}."
@@ -5,7 +5,7 @@ require "rails/source_annotation_extractor"
5
5
  module Rails
6
6
  module Command
7
7
  class NotesCommand < Base # :nodoc:
8
- class_option :annotations, aliases: "-a", desc: "Filter by specific annotations, e.g. Foobar TODO", type: :array, default: Rails::SourceAnnotationExtractor::Annotation.tags
8
+ class_option :annotations, aliases: "-a", desc: "Filter by specific annotations, e.g. Foobar TODO", type: :array
9
9
 
10
10
  def perform(*)
11
11
  require_application_and_environment!
@@ -15,7 +15,7 @@ module Rails
15
15
 
16
16
  private
17
17
  def display_annotations
18
- annotations = options[:annotations]
18
+ annotations = options[:annotations] || Rails::SourceAnnotationExtractor::Annotation.tags
19
19
  tag = (annotations.length > 1)
20
20
 
21
21
  Rails::SourceAnnotationExtractor.enumerate annotations.join("|"), tag: tag, dirs: directories
data/lib/rails/engine.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "rails/railtie"
4
4
  require "rails/engine/railties"
5
+ require "active_support/callbacks"
5
6
  require "active_support/core_ext/module/delegation"
6
7
  require "active_support/core_ext/object/try"
7
8
  require "pathname"
@@ -422,6 +423,9 @@ module Rails
422
423
  end
423
424
  end
424
425
 
426
+ include ActiveSupport::Callbacks
427
+ define_callbacks :load_seed
428
+
425
429
  delegate :middleware, :root, :paths, to: :config
426
430
  delegate :engine_name, :isolated?, to: :class
427
431
 
@@ -559,13 +563,7 @@ module Rails
559
563
  # Blog::Engine.load_seed
560
564
  def load_seed
561
565
  seed_file = paths["db/seeds.rb"].existent.first
562
- return unless seed_file
563
-
564
- if config.try(:active_job)&.queue_adapter == :async
565
- with_inline_jobs { load(seed_file) }
566
- else
567
- load(seed_file)
568
- end
566
+ run_callbacks(:load_seed) { load(seed_file) } if seed_file
569
567
  end
570
568
 
571
569
  initializer :load_environment_config, before: :load_environment_hook, group: :all do
@@ -637,6 +635,12 @@ module Rails
637
635
  end
638
636
  end
639
637
 
638
+ initializer :wrap_executor_around_load_seed do |app|
639
+ self.class.set_callback(:load_seed, :around) do |engine, seeds_block|
640
+ app.executor.wrap(&seeds_block)
641
+ end
642
+ end
643
+
640
644
  initializer :engines_blank_point do
641
645
  # We need this initializer so all extra initializers added in engines are
642
646
  # consistently executed after all the initializers above across all engines.
@@ -678,18 +682,6 @@ module Rails
678
682
  end
679
683
  end
680
684
 
681
- def with_inline_jobs
682
- queue_adapter = config.active_job.queue_adapter
683
- ActiveSupport.on_load(:active_job) do
684
- self.queue_adapter = :inline
685
- end
686
- yield
687
- ensure
688
- ActiveSupport.on_load(:active_job) do
689
- self.queue_adapter = queue_adapter
690
- end
691
- end
692
-
693
685
  def has_migrations?
694
686
  paths["db/migrate"].existent.any?
695
687
  end
@@ -9,8 +9,8 @@ module Rails
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 1
12
- TINY = 0
13
- PRE = "rc1"
12
+ TINY = 2
13
+ PRE = "1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -111,11 +111,11 @@ module Rails
111
111
  # file in <tt>config/environments</tt>.
112
112
  #
113
113
  # environment do
114
- # "config.action_controller.asset_host = 'cdn.provider.com'"
114
+ # "config.asset_host = 'cdn.provider.com'"
115
115
  # end
116
116
  #
117
117
  # environment(nil, env: "development") do
118
- # "config.action_controller.asset_host = 'localhost:3000'"
118
+ # "config.asset_host = 'localhost:3000'"
119
119
  # end
120
120
  def environment(data = nil, options = {})
121
121
  sentinel = "class Application < Rails::Application\n"
@@ -98,7 +98,7 @@ module Rails
98
98
  desc: "Set up the #{name} with Gemfile pointing to Rails repository"
99
99
 
100
100
  class_option :master, type: :boolean, default: false,
101
- desc: "Set up the #{name} with Gemfile pointing to Rails repository master branch"
101
+ desc: "Set up the #{name} with Gemfile pointing to Rails repository main branch"
102
102
 
103
103
  class_option :rc, type: :string, default: nil,
104
104
  desc: "Path to file containing extra configuration options for rails command"
@@ -110,8 +110,9 @@ module Rails
110
110
  desc: "Show this help message and quit"
111
111
  end
112
112
 
113
- def initialize(*args)
114
- @gem_filter = lambda { |gem| true }
113
+ def initialize(positional_argv, option_argv, *)
114
+ @argv = [*positional_argv, *option_argv]
115
+ @gem_filter = lambda { |gem| true }
115
116
  @extra_entries = []
116
117
  super
117
118
  end
@@ -172,9 +173,14 @@ module Rails
172
173
  end
173
174
 
174
175
  def apply_rails_template # :doc:
176
+ original_argv = ARGV.dup
177
+ ARGV.replace(@argv)
178
+
175
179
  apply rails_template if rails_template
176
180
  rescue Thor::Error, LoadError, Errno::ENOENT => e
177
181
  raise Error, "The template [#{rails_template}] could not be loaded. Error: #{e}"
182
+ ensure
183
+ ARGV.replace(original_argv)
178
184
  end
179
185
 
180
186
  def set_default_accessors! # :doc:
@@ -295,16 +301,16 @@ module Rails
295
301
  ]
296
302
  elsif options.edge?
297
303
  [
298
- GemfileEntry.github("rails", "rails/rails")
304
+ GemfileEntry.github("rails", "rails/rails", "main")
299
305
  ]
300
306
  elsif options.master?
301
307
  [
302
- GemfileEntry.github("rails", "rails/rails", "master")
308
+ GemfileEntry.github("rails", "rails/rails", "main")
303
309
  ]
304
310
  else
305
311
  [GemfileEntry.version("rails",
306
312
  rails_version_specifier,
307
- "Bundle edge Rails instead: gem 'rails', github: 'rails/rails'")]
313
+ "Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'")]
308
314
  end
309
315
  end
310
316
 
@@ -330,11 +336,7 @@ module Rails
330
336
  def webpacker_gemfile_entry
331
337
  return [] if options[:skip_javascript]
332
338
 
333
- if options.dev? || options.edge? || options.master?
334
- GemfileEntry.github "webpacker", "rails/webpacker", nil, "Use development version of Webpacker"
335
- else
336
- GemfileEntry.version "webpacker", "~> 5.0", "Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker"
337
- end
339
+ GemfileEntry.version "webpacker", "~> 5.0", "Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker"
338
340
  end
339
341
 
340
342
  def jbuilder_gemfile_entry
@@ -1,4 +1,4 @@
1
- <%%= form_with(model: <%= model_resource_name %>, local: true) do |form| %>
1
+ <%%= form_with(model: <%= model_resource_name %>) do |form| %>
2
2
  <%% if <%= singular_table_name %>.errors.any? %>
3
3
  <div id="error_explanation">
4
4
  <h2><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>
@@ -138,7 +138,7 @@ module Rails
138
138
  rack_cors_config_exist = File.exist?("config/initializers/cors.rb")
139
139
  assets_config_exist = File.exist?("config/initializers/assets.rb")
140
140
  csp_config_exist = File.exist?("config/initializers/content_security_policy.rb")
141
- feature_policy_config_exist = File.exist?("config/initializers/feature_policy.rb")
141
+ permissions_policy_config_exist = File.exist?("config/initializers/permissions_policy.rb")
142
142
 
143
143
  @config_target_version = Rails.application.config.loaded_config_version || "5.0"
144
144
 
@@ -174,8 +174,8 @@ module Rails
174
174
  remove_file "config/initializers/content_security_policy.rb"
175
175
  end
176
176
 
177
- unless feature_policy_config_exist
178
- remove_file "config/initializers/feature_policy.rb"
177
+ unless permissions_policy_config_exist
178
+ remove_file "config/initializers/permissions_policy.rb"
179
179
  end
180
180
  end
181
181
  end
@@ -527,7 +527,7 @@ module Rails
527
527
  if options[:api]
528
528
  remove_file "config/initializers/cookies_serializer.rb"
529
529
  remove_file "config/initializers/content_security_policy.rb"
530
- remove_file "config/initializers/feature_policy.rb"
530
+ remove_file "config/initializers/permissions_policy.rb"
531
531
  end
532
532
  end
533
533
 
@@ -49,14 +49,14 @@ group :development do
49
49
  <%- if options.dev? || options.edge? || options.master? -%>
50
50
  gem 'web-console', github: 'rails/web-console'
51
51
  <%- else -%>
52
- gem 'web-console', '>= 4.0.3'
52
+ gem 'web-console', '>= 4.1.0'
53
53
  <%- end -%>
54
54
  # Display performance information such as SQL time and flame graphs for each request in your browser.
55
55
  # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
56
56
  gem 'rack-mini-profiler', '~> 2.0'
57
57
  <%- end -%>
58
58
  <% if depend_on_listen? -%>
59
- gem 'listen', '~> 3.2'
59
+ gem 'listen', '~> 3.3'
60
60
  <% end -%>
61
61
  <% if spring_install? -%>
62
62
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
@@ -21,10 +21,3 @@ Turbolinks.start()
21
21
  <%- unless skip_active_storage? -%>
22
22
  ActiveStorage.start()
23
23
  <%- end -%>
24
-
25
- // Uncomment to copy all static images under ../images to the output folder and reference
26
- // them with the image_pack_tag helper in views (e.g <%%= image_pack_tag 'rails.png' %>)
27
- // or the `imagePath` JavaScript helper below.
28
- //
29
- // const images = require.context('../images', true)
30
- // const imagePath = (name) => images(name, true)
@@ -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
5
  require_relative "../config/boot"
3
6
  require "rails/commands"
@@ -1,3 +1,6 @@
1
+ <% if spring_install? -%>
2
+ load File.expand_path("spring", __dir__)
3
+ <% end -%>
1
4
  require_relative "../config/boot"
2
5
  require "rake"
3
6
  Rake.application.run
@@ -1,7 +1,13 @@
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"
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
7
13
  end
@@ -1,8 +1,16 @@
1
1
  APP_ROOT = File.expand_path('..', __dir__)
2
2
  Dir.chdir(APP_ROOT) do
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
3
+ yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
4
+ select { |dir| File.expand_path(dir) != __dir__ }.
5
+ product(["yarn", "yarn.cmd", "yarn.ps1"]).
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
12
+ $stderr.puts "Yarn executable was not detected in the system."
13
+ $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
14
+ exit 1
15
+ end
8
16
  end
@@ -32,10 +32,13 @@ module <%= app_const_base %>
32
32
  config.load_defaults Rails::VERSION::STRING.to_f
33
33
  <%- end -%>
34
34
 
35
- # Settings in config/environments/* take precedence over those specified here.
36
- # Application configuration can go into files in config/initializers
37
- # -- all .rb files in that directory are automatically loaded after loading
38
- # 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")
39
42
  <%- if options.api? -%>
40
43
 
41
44
  # Only loads a smaller set of middleware suitable for API only apps.
@@ -1,10 +1,4 @@
1
1
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2
- <% if spring_install? -%>
3
-
4
- if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"])
5
- load File.expand_path("../bin/spring", __dir__)
6
- end
7
- <% end -%>
8
2
 
9
3
  require "bundler/setup" # Set up gems listed in the Gemfile.
10
4
  <% if depend_on_bootsnap? -%>
@@ -35,7 +35,7 @@ Rails.application.configure do
35
35
 
36
36
  <%- end -%>
37
37
  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
38
- # config.action_controller.asset_host = 'http://assets.example.com'
38
+ # config.asset_host = 'http://assets.example.com'
39
39
 
40
40
  # Specifies the header that your server uses for sending files.
41
41
  # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
@@ -43,3 +43,25 @@
43
43
  # effect. For applications using multiple databases, this new API provides
44
44
  # support for granular connection swapping.
45
45
  # Rails.application.config.active_record.legacy_connection_handling = false
46
+
47
+ # Make `form_with` generate non-remote forms by default.
48
+ # Rails.application.config.action_view.form_with_generates_remote_forms = false
49
+
50
+ # Set the default queue name for the analysis job to the queue adapter default.
51
+ # Rails.application.config.active_storage.queues.analysis = nil
52
+
53
+ # Set the default queue name for the purge job to the queue adapter default.
54
+ # Rails.application.config.active_storage.queues.purge = nil
55
+
56
+ # Set the default queue name for the incineration job to the queue adapter default.
57
+ # Rails.application.config.action_mailbox.queues.incineration = nil
58
+
59
+ # Set the default queue name for the routing job to the queue adapter default.
60
+ # Rails.application.config.action_mailbox.queues.routing = nil
61
+
62
+ # Set the default queue name for the mail deliver job to the queue adapter default.
63
+ # Rails.application.config.action_mailer.deliver_later_queue_name = nil
64
+
65
+ # Generate a `Link` header that gives a hint to modern browsers about
66
+ # preloading assets when using `javascript_include_tag` and `stylesheet_link_tag`.
67
+ # Rails.application.config.action_view.preload_links_header = true
@@ -1,7 +1,7 @@
1
- # Define an application-wide HTTP feature policy. For further
1
+ # Define an application-wide HTTP permissions policy. For further
2
2
  # information see https://developers.google.com/web/updates/2018/06/feature-policy
3
3
  #
4
- # Rails.application.config.feature_policy do |f|
4
+ # Rails.application.config.permissions_policy do |f|
5
5
  # f.camera :none
6
6
  # f.gyroscope :none
7
7
  # f.microphone :none
@@ -8,6 +8,11 @@ max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
8
  min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
9
9
  threads min_threads_count, max_threads_count
10
10
 
11
+ # Specifies the `worker_timeout` threshold that Puma will use to wait before
12
+ # terminating a worker in development environments.
13
+ #
14
+ worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
15
+
11
16
  # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
12
17
  #
13
18
  port ENV.fetch("PORT") { 3000 }
@@ -103,6 +103,7 @@ task default: :test
103
103
  opts = options.transform_keys(&:to_sym).except(*DUMMY_IGNORE_OPTIONS)
104
104
  opts[:force] = force
105
105
  opts[:skip_bundle] = true
106
+ opts[:skip_spring] = true
106
107
  opts[:skip_listen] = true
107
108
  opts[:skip_git] = true
108
109
  opts[:skip_turbolinks] = true
data/lib/rails/railtie.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "rails/initializable"
4
+ require "active_support/descendants_tracker"
4
5
  require "active_support/inflector"
5
6
  require "active_support/core_ext/module/introspection"
6
7
  require "active_support/core_ext/module/delegation"
@@ -119,11 +120,11 @@ module Rails
119
120
  # this less confusing for everyone.
120
121
  # It can be used like this:
121
122
  #
122
- # class MyRailtie < Rails::Railtie
123
- # server do
124
- # WebpackServer.start
123
+ # class MyRailtie < Rails::Railtie
124
+ # server do
125
+ # WebpackServer.start
126
+ # end
125
127
  # end
126
- # end
127
128
  #
128
129
  # == Application and Engine
129
130
  #
@@ -135,6 +136,7 @@ module Rails
135
136
  class Railtie
136
137
  autoload :Configuration, "rails/railtie/configuration"
137
138
 
139
+ extend ActiveSupport::DescendantsTracker
138
140
  include Initializable
139
141
 
140
142
  ABSTRACT_RAILTIES = %w(Rails::Railtie Rails::Engine Rails::Application)
@@ -144,13 +146,7 @@ module Rails
144
146
  delegate :config, to: :instance
145
147
 
146
148
  def subclasses
147
- @subclasses ||= []
148
- end
149
-
150
- def inherited(base)
151
- unless base.abstract_railtie?
152
- subclasses << base
153
- end
149
+ super.reject(&:abstract_railtie?)
154
150
  end
155
151
 
156
152
  def rake_tasks(&blk)
@@ -8,11 +8,23 @@ namespace :yarn do
8
8
  node_env = ENV.fetch("NODE_ENV") do
9
9
  valid_node_envs.include?(Rails.env) ? Rails.env : "production"
10
10
  end
11
- system({ "NODE_ENV" => node_env }, "#{Rails.root}/bin/yarn install --no-progress --frozen-lockfile")
11
+
12
+ yarn_flags =
13
+ if `"#{Rails.root}/bin/yarn" --version`.start_with?("1")
14
+ "--no-progress --frozen-lockfile"
15
+ else
16
+ "--immutable"
17
+ end
18
+
19
+ system({ "NODE_ENV" => node_env }, "\"#{Rails.root}/bin/yarn\" install #{yarn_flags}")
20
+ rescue Errno::ENOENT
21
+ $stderr.puts "bin/yarn was not found."
22
+ $stderr.puts "Please run `bundle exec rails app:update:bin` to create it."
23
+ exit 1
12
24
  end
13
25
  end
14
26
 
15
27
  # Run Yarn prior to Sprockets assets precompilation, so dependencies are available for use.
16
- if Rake::Task.task_defined?("assets:precompile")
28
+ if Rake::Task.task_defined?("assets:precompile") && File.exist?(Rails.root.join("bin", "yarn"))
17
29
  Rake::Task["assets:precompile"].enhance [ "yarn:install" ]
18
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railties
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0.rc1
4
+ version: 6.1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-02 00:00:00.000000000 Z
11
+ date: 2021-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 6.1.0.rc1
19
+ version: 6.1.2.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 6.1.0.rc1
26
+ version: 6.1.2.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionpack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 6.1.0.rc1
33
+ version: 6.1.2.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 6.1.0.rc1
40
+ version: 6.1.2.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 6.1.0.rc1
89
+ version: 6.1.2.1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 6.1.0.rc1
96
+ version: 6.1.2.1
97
97
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
98
98
  email: david@loudthinking.com
99
99
  executables:
@@ -248,11 +248,11 @@ files:
248
248
  - lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt
249
249
  - lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rb.tt
250
250
  - lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt
251
- - lib/rails/generators/rails/app/templates/config/initializers/feature_policy.rb.tt
252
251
  - lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt
253
252
  - lib/rails/generators/rails/app/templates/config/initializers/inflections.rb.tt
254
253
  - lib/rails/generators/rails/app/templates/config/initializers/mime_types.rb.tt
255
254
  - lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt
255
+ - lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt
256
256
  - lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt
257
257
  - lib/rails/generators/rails/app/templates/config/locales/en.yml
258
258
  - lib/rails/generators/rails/app/templates/config/puma.rb.tt
@@ -426,10 +426,10 @@ licenses:
426
426
  - MIT
427
427
  metadata:
428
428
  bug_tracker_uri: https://github.com/rails/rails/issues
429
- changelog_uri: https://github.com/rails/rails/blob/v6.1.0.rc1/railties/CHANGELOG.md
430
- documentation_uri: https://api.rubyonrails.org/v6.1.0.rc1/
429
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.2.1/railties/CHANGELOG.md
430
+ documentation_uri: https://api.rubyonrails.org/v6.1.2.1/
431
431
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
432
- source_code_uri: https://github.com/rails/rails/tree/v6.1.0.rc1/railties
432
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.2.1/railties
433
433
  post_install_message:
434
434
  rdoc_options:
435
435
  - "--exclude"
@@ -443,11 +443,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
443
443
  version: 2.5.0
444
444
  required_rubygems_version: !ruby/object:Gem::Requirement
445
445
  requirements:
446
- - - ">"
446
+ - - ">="
447
447
  - !ruby/object:Gem::Version
448
- version: 1.3.1
448
+ version: '0'
449
449
  requirements: []
450
- rubygems_version: 3.1.4
450
+ rubygems_version: 3.0.3
451
451
  signing_key:
452
452
  specification_version: 4
453
453
  summary: Tools for creating, working with, and running Rails applications.