railties 7.0.4.3 → 7.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd91d4a0d1e4fac103d10a754650b06829501e7352fd942181a307575de37d87
4
- data.tar.gz: 18dc783f7038b79b1517f3a1a62facb2aff18310a92dfb6105f98affc7b09a8b
3
+ metadata.gz: 31de139d3dd6b07593f8487f29eaecedf797ce2ff8662c7d2052b36de5fb62c9
4
+ data.tar.gz: 650547b1eec93edd4308b378d024626eaf17b848d001b33462fe32aaefebbe8e
5
5
  SHA512:
6
- metadata.gz: c9f6188e4ba22dfd566b9fa39da12e0a2fe773b5ee6f4d8e0598a41995d628ee9a671d6233d18d710161e989935446701c2c1632d5413faf9049bb9b6a11ac2c
7
- data.tar.gz: 768e9b9a6597c9e7004772465ddddf22c92c7de9f2834720a512dc2fee9af34f9b82ca9057c98f270920c7eaee6ed752bfa7478d7e49bb7f08197dd361a3b66a
6
+ metadata.gz: 5ca96bbe34aebacce397ecd5aa9e87dd998a306acfa56fd94a5141ffafdb81dfe527bb95a6a7a31f54e53f663d056d5e89ae0b56d74aefa10b116c79b66fbcbf
7
+ data.tar.gz: 9d479e75785bcfb8d54d789dc666a34a462d65511dd54d15a3b0e75d2c405835d9a9b0f32ae7234306378de347bdf70a002cf4be4e0fa08eb221a943b78e7b22
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## Rails 7.0.5 (May 24, 2023) ##
2
+
3
+ * Add puma app server to Gemfile in order to start test/dummy.
4
+
5
+ *Donapieppo*
6
+
7
+ * Rails console now disables `IRB`'s autocompletion feature in production by default.
8
+
9
+ Setting `IRB_USE_AUTOCOMPLETE=true` can override this default.
10
+
11
+ *Stan Lo*
12
+
13
+ * Send 303 See Other status code back for the destroy action on newly generated
14
+ scaffold controllers.
15
+
16
+ *Tony Drake*
17
+
18
+
1
19
  ## Rails 7.0.4.3 (March 13, 2023) ##
2
20
 
3
21
  * No changes.
@@ -422,44 +422,39 @@ module Rails
422
422
  end
423
423
  end
424
424
 
425
- # Decrypts the credentials hash as kept in +config/credentials.yml.enc+. This file is encrypted with
426
- # the Rails master key, which is either taken from <tt>ENV["RAILS_MASTER_KEY"]</tt> or from loading
427
- # +config/master.key+.
428
- # If specific credentials file exists for current environment, it takes precedence, thus for +production+
429
- # environment look first for +config/credentials/production.yml.enc+ with master key taken
430
- # from <tt>ENV["RAILS_MASTER_KEY"]</tt> or from loading +config/credentials/production.key+.
431
- # Default behavior can be overwritten by setting +config.credentials.content_path+ and +config.credentials.key_path+.
425
+ # Returns an ActiveSupport::EncryptedConfiguration instance for the
426
+ # credentials file specified by +config.credentials.content_path+.
427
+ #
428
+ # By default, +config.credentials.content_path+ will point to either
429
+ # <tt>config/credentials/#{environment}.yml.enc</tt> for the current
430
+ # environment (for example, +config/credentials/production.yml.enc+ for the
431
+ # +production+ environment), or +config/credentials.yml.enc+ if that file
432
+ # does not exist.
433
+ #
434
+ # The encryption key is taken from either <tt>ENV["RAILS_MASTER_KEY"]</tt>,
435
+ # or from the file specified by +config.credentials.key_path+. By default,
436
+ # +config.credentials.key_path+ will point to either
437
+ # <tt>config/credentials/#{environment}.key</tt> for the current
438
+ # environment, or +config/master.key+ if that file does not exist.
432
439
  def credentials
433
440
  @credentials ||= encrypted(config.credentials.content_path, key_path: config.credentials.key_path)
434
441
  end
435
442
 
436
- # Shorthand to decrypt any encrypted configurations or files.
437
- #
438
- # For any file added with <tt>rails encrypted:edit</tt> call +read+ to decrypt
439
- # the file with the master key.
440
- # The master key is either stored in +config/master.key+ or <tt>ENV["RAILS_MASTER_KEY"]</tt>.
441
- #
442
- # Rails.application.encrypted("config/mystery_man.txt.enc").read
443
- # # => "We've met before, haven't we?"
444
- #
445
- # It's also possible to interpret encrypted YAML files with +config+.
446
- #
447
- # Rails.application.encrypted("config/credentials.yml.enc").config
448
- # # => { next_guys_line: "I don't think so. Where was it you think we met?" }
449
- #
450
- # Any top-level configs are also accessible directly on the return value:
451
- #
452
- # Rails.application.encrypted("config/credentials.yml.enc").next_guys_line
453
- # # => "I don't think so. Where was it you think we met?"
443
+ # Returns an ActiveSupport::EncryptedConfiguration instance for an encrypted
444
+ # file. By default, the encryption key is taken from either
445
+ # <tt>ENV["RAILS_MASTER_KEY"]</tt>, or from the +config/master.key+ file.
454
446
  #
455
- # The files or configs can also be encrypted with a custom key. To decrypt with
456
- # a key in the +ENV+, use:
447
+ # my_config = Rails.application.encrypted("config/my_config.enc")
457
448
  #
458
- # Rails.application.encrypted("config/special_tokens.yml.enc", env_key: "SPECIAL_TOKENS")
449
+ # my_config.read
450
+ # # => "foo:\n bar: 123\n"
459
451
  #
460
- # Or to decrypt with a file, that should be version control ignored, relative to +Rails.root+:
452
+ # my_config.foo.bar
453
+ # # => 123
461
454
  #
462
- # Rails.application.encrypted("config/special_tokens.yml.enc", key_path: "config/special_tokens.key")
455
+ # Encrypted files can be edited with the <tt>bin/rails encrypted:edit</tt>
456
+ # command. (See the output of <tt>bin/rails encrypted:edit --help</tt> for
457
+ # more information.)
463
458
  def encrypted(path, key_path: "config/master.key", env_key: "RAILS_MASTER_KEY")
464
459
  ActiveSupport::EncryptedConfiguration.new(
465
460
  config_path: Rails.root.join(path),
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Rails::ApplicationController < ActionController::Base # :nodoc:
4
- self.view_paths = File.expand_path("templates", __dir__)
4
+ prepend_view_path File.expand_path("templates", __dir__)
5
5
  layout "application"
6
6
 
7
7
  before_action :disable_content_security_policy_nonce!
@@ -38,6 +38,10 @@ module Rails
38
38
 
39
39
  if @console == IRB
40
40
  IRB::WorkSpace.prepend(BacktraceCleaner)
41
+
42
+ if Rails.env.production?
43
+ ENV["IRB_USE_AUTOCOMPLETE"] ||= "false"
44
+ end
41
45
  end
42
46
  end
43
47
 
@@ -9,8 +9,8 @@ module Rails
9
9
  module VERSION
10
10
  MAJOR = 7
11
11
  MINOR = 0
12
- TINY = 4
13
- PRE = "3"
12
+ TINY = 5
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -274,7 +274,7 @@ module Rails
274
274
  class_option :api, type: :boolean, desc: "Preconfigure smaller stack for API only apps"
275
275
  class_option :minimal, type: :boolean, desc: "Preconfigure a minimal rails app"
276
276
  class_option :javascript, type: :string, aliases: "-j", default: "importmap", desc: "Choose JavaScript approach [options: importmap (default), webpack, esbuild, rollup]"
277
- class_option :css, type: :string, aliases: "-c", desc: "Choose CSS processor [options: tailwind, bootstrap, bulma, postcss, sass... check https://github.com/rails/cssbundling-rails]"
277
+ class_option :css, type: :string, aliases: "-c", desc: "Choose CSS processor [options: tailwind, bootstrap, bulma, postcss, sass] check https://github.com/rails/cssbundling-rails"
278
278
  class_option :skip_bundle, type: :boolean, aliases: "-B", default: false, desc: "Don't run bundle install"
279
279
 
280
280
  def initialize(*args)
@@ -438,7 +438,7 @@ module Rails
438
438
 
439
439
  def delete_app_views_if_api_option
440
440
  if options[:api]
441
- if options[:skip_action_mailer]
441
+ if skip_action_mailer?
442
442
  remove_dir "app/views"
443
443
  else
444
444
  remove_file "app/views/layouts/application.html.erb"
@@ -483,7 +483,7 @@ module Rails
483
483
  end
484
484
 
485
485
  def delete_action_mailer_files_skipping_action_mailer
486
- if options[:skip_action_mailer]
486
+ if skip_action_mailer?
487
487
  remove_file "app/views/layouts/mailer.html.erb"
488
488
  remove_file "app/views/layouts/mailer.text.erb"
489
489
  remove_dir "app/mailers"
@@ -39,7 +39,7 @@ Rails.application.configure do
39
39
  # Store uploaded files on the local file system (see config/storage.yml for options).
40
40
  config.active_storage.service = :local
41
41
  <%- end -%>
42
- <%- unless options.skip_action_mailer? -%>
42
+ <%- unless skip_action_mailer? -%>
43
43
 
44
44
  # Don't care if the mailer can't send.
45
45
  config.action_mailer.raise_delivery_errors = false
@@ -72,7 +72,7 @@ Rails.application.configure do
72
72
  # config.active_job.queue_name_prefix = "<%= app_name %>_production"
73
73
 
74
74
  <%- end -%>
75
- <%- unless options.skip_action_mailer? -%>
75
+ <%- unless skip_action_mailer? -%>
76
76
  config.action_mailer.perform_caching = false
77
77
 
78
78
  # Ignore bad email addresses and do not raise email delivery errors.
@@ -38,7 +38,7 @@ Rails.application.configure do
38
38
  config.active_storage.service = :test
39
39
 
40
40
  <%- end -%>
41
- <%- unless options.skip_action_mailer? -%>
41
+ <%- unless skip_action_mailer? -%>
42
42
  config.action_mailer.perform_caching = false
43
43
 
44
44
  # Tell Action Mailer not to deliver emails to the real world.
@@ -109,7 +109,7 @@
109
109
 
110
110
 
111
111
  # Cookie serializer: 2 options
112
- #
112
+ #
113
113
  # If you're upgrading and haven't set `cookies_serializer` previously, your cookie serializer
114
114
  # is `:marshal`. The default for new apps is `:json`.
115
115
  #
@@ -117,10 +117,10 @@
117
117
  #
118
118
  #
119
119
  # To migrate an existing application to the `:json` serializer, use the `:hybrid` option.
120
- #
120
+ #
121
121
  # Rails transparently deserializes existing (Marshal-serialized) cookies on read and
122
122
  # re-writes them in the JSON format.
123
- #
123
+ #
124
124
  # It is fine to use `:hybrid` long term; you should do that until you're confident *all* your cookies
125
125
  # have been converted to JSON. To keep using `:hybrid` long term, move this config to its own
126
126
  # initializer or to `config/application.rb`.
@@ -131,5 +131,18 @@
131
131
  # If your cookies can't yet be serialized to JSON, keep using `:marshal` for backward-compatibility.
132
132
  #
133
133
  # If you have configured the serializer elsewhere, you can remove this section of the file.
134
- #
134
+ #
135
135
  # See https://guides.rubyonrails.org/action_controller_overview.html#cookies for more information.
136
+
137
+ # Change the return value of `ActionDispatch::Request#content_type` to the Content-Type header without modification.
138
+ # Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type = false
139
+
140
+ # Active Storage `has_many_attached` relationships will default to replacing the current collection instead of appending to it.
141
+ # Thus, to support submitting an empty collection, the `file_field` helper will render an hidden field `include_hidden` by default when `multiple_file_field_include_hidden` is set to `true`.
142
+ # See https://guides.rubyonrails.org/configuring.html#config-active-storage-multiple-file-field-include-hidden for more information.
143
+ # Rails.application.config.active_storage.multiple_file_field_include_hidden = true
144
+
145
+ # ** Please read carefully, this must be configured in config/application.rb (NOT this file) **
146
+ # Disables the deprecated #to_s override in some Ruby core classes
147
+ # See https://guides.rubyonrails.org/configuring.html#config-active-support-disable-to-s-conversion for more information.
148
+ # config.active_support.disable_to_s_conversion = true
@@ -28,14 +28,14 @@ module Rails
28
28
 
29
29
  empty_directory_with_keep_file "app/models/concerns"
30
30
  empty_directory_with_keep_file "app/controllers/concerns"
31
- remove_dir "app/mailers" if options[:skip_action_mailer]
31
+ remove_dir "app/mailers" if skip_action_mailer?
32
32
  remove_dir "app/jobs" if options[:skip_active_job]
33
33
  elsif full?
34
34
  empty_directory_with_keep_file "app/models"
35
35
  empty_directory_with_keep_file "app/controllers"
36
36
  empty_directory_with_keep_file "app/models/concerns"
37
37
  empty_directory_with_keep_file "app/controllers/concerns"
38
- empty_directory_with_keep_file "app/mailers" unless options[:skip_action_mailer]
38
+ empty_directory_with_keep_file "app/mailers" unless skip_action_mailer?
39
39
  empty_directory_with_keep_file "app/jobs" unless options[:skip_active_job]
40
40
 
41
41
  unless api?
@@ -317,6 +317,7 @@ module Rails
317
317
  [
318
318
  rails_gemfile_entry,
319
319
  simplify_gemfile_entries(
320
+ web_server_gemfile_entry,
320
321
  database_gemfile_entry,
321
322
  asset_pipeline_gemfile_entry,
322
323
  ),
@@ -8,9 +8,9 @@ Gem::Specification.new do |spec|
8
8
  spec.homepage = "TODO"
9
9
  spec.summary = "TODO: Summary of <%= camelized_modules %>."
10
10
  spec.description = "TODO: Description of <%= camelized_modules %>."
11
- <% unless inside_application? -%>
11
+ <%- unless inside_application? -%>
12
12
  spec.license = "MIT"
13
- <% end -%>
13
+ <%- end -%>
14
14
 
15
15
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the "allowed_push_host"
16
16
  # to allow pushing to a single host or delete this section to allow pushing to any host.
@@ -17,11 +17,13 @@ require "rails/all"
17
17
  require "rails"
18
18
  # Pick the frameworks you want:
19
19
  require "active_model/railtie"
20
- require "active_job/railtie"
20
+ <%= comment_if :skip_active_job %>require "active_job/railtie"
21
21
  <%= comment_if :skip_active_record %>require "active_record/railtie"
22
22
  <%= comment_if :skip_active_storage %>require "active_storage/engine"
23
23
  require "action_controller/railtie"
24
24
  <%= comment_if :skip_action_mailer %>require "action_mailer/railtie"
25
+ <%= comment_if :skip_action_mailbox %>require "action_mailbox/engine"
26
+ <%= comment_if :skip_action_text %>require "action_text/engine"
25
27
  require "action_view/railtie"
26
28
  <%= comment_if :skip_action_cable %>require "action_cable/engine"
27
29
  <%= comment_if :skip_test %>require "rails/test_unit/railtie"
@@ -43,7 +43,7 @@ class <%= controller_class_name %>Controller < ApplicationController
43
43
  # DELETE <%= route_url %>/1
44
44
  def destroy
45
45
  @<%= orm_instance.destroy %>
46
- redirect_to <%= index_helper %>_url, notice: <%= %("#{human_name} was successfully destroyed.") %>
46
+ redirect_to <%= index_helper %>_url, notice: <%= %("#{human_name} was successfully destroyed.") %>, status: :see_other
47
47
  end
48
48
 
49
49
  private
@@ -67,7 +67,7 @@ module Rails
67
67
  def run_generator(args = default_arguments, config = {})
68
68
  capture(:stdout) do
69
69
  args += ["--skip-bundle"] unless args.include?("--no-skip-bundle") || args.include?("--dev")
70
- args |= ["--skip-bootsnap"] unless args.include?("--no-skip-bootsnap")
70
+ args += ["--skip-bootsnap"] unless args.include?("--no-skip-bootsnap") || args.include?("--skip-bootsnap")
71
71
 
72
72
  generator_class.start(args, config.reverse_merge(destination_root: destination_root))
73
73
  end
@@ -31,6 +31,10 @@ if defined?(ActiveRecord::Base)
31
31
  ActiveSupport.on_load(:action_dispatch_integration_test) do
32
32
  self.fixture_path = ActiveSupport::TestCase.fixture_path
33
33
  end
34
+ else
35
+ ActiveSupport.on_load(:active_support_test_case) do
36
+ self.file_fixture_path = "#{Rails.root}/test/fixtures/files"
37
+ end
34
38
  end
35
39
 
36
40
  # :enddoc:
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: 7.0.4.3
4
+ version: 7.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-13 00:00:00.000000000 Z
11
+ date: 2023-05-24 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: 7.0.4.3
19
+ version: 7.0.5
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: 7.0.4.3
26
+ version: 7.0.5
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: 7.0.4.3
33
+ version: 7.0.5
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: 7.0.4.3
40
+ version: 7.0.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 7.0.4.3
103
+ version: 7.0.5
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 7.0.4.3
110
+ version: 7.0.5
111
111
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
112
112
  email: david@loudthinking.com
113
113
  executables:
@@ -422,12 +422,12 @@ licenses:
422
422
  - MIT
423
423
  metadata:
424
424
  bug_tracker_uri: https://github.com/rails/rails/issues
425
- changelog_uri: https://github.com/rails/rails/blob/v7.0.4.3/railties/CHANGELOG.md
426
- documentation_uri: https://api.rubyonrails.org/v7.0.4.3/
425
+ changelog_uri: https://github.com/rails/rails/blob/v7.0.5/railties/CHANGELOG.md
426
+ documentation_uri: https://api.rubyonrails.org/v7.0.5/
427
427
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
428
- source_code_uri: https://github.com/rails/rails/tree/v7.0.4.3/railties
428
+ source_code_uri: https://github.com/rails/rails/tree/v7.0.5/railties
429
429
  rubygems_mfa_required: 'true'
430
- post_install_message:
430
+ post_install_message:
431
431
  rdoc_options:
432
432
  - "--exclude"
433
433
  - "."
@@ -444,8 +444,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
444
444
  - !ruby/object:Gem::Version
445
445
  version: '0'
446
446
  requirements: []
447
- rubygems_version: 3.4.3
448
- signing_key:
447
+ rubygems_version: 3.4.10
448
+ signing_key:
449
449
  specification_version: 4
450
450
  summary: Tools for creating, working with, and running Rails applications.
451
451
  test_files: []