railties 7.1.3.4 → 7.1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a713c038c0add6ec4194a1c5c48a7e2f5f82da156d84e8af357d48cbb914f0e
4
- data.tar.gz: 77a6b444181b72e1e506c8d3335fa596b1bcaf62c2adfdd3cbda2671fc104fde
3
+ metadata.gz: d2180e487eebd7468860fb9be741899fb62261c42712d1164e5360c251e63ac4
4
+ data.tar.gz: 05eec22a7ca9d14e41279f18d7179b23336934368ab0ba475c88666897733a99
5
5
  SHA512:
6
- metadata.gz: e97b5e4b13e4d6b53ce3cd3d7fe7a586f58f5eb66b644043c7fade27354c951831b5112e99353c5b89f54ba5f9e2c5a6fc8bffe58d963acbcbd910aba55201fd
7
- data.tar.gz: 8fb0f94946b9e5b3ce9f7212a9e8c8752fb53056b45016cadb7d40cc062b07d1636d4af4f402fa9250b41796e5a7b90e954324b5c3651921919e0f064b3b03fc
6
+ metadata.gz: ff4902a2720fa0263b081afbdc4b4ddb066e6d7f72167777cbd4c9d0729e9748f1ad38985dd62cd8154d20884433edd2ab6d7ed3ef6404940c25ff3d2e8f6fb5
7
+ data.tar.gz: f854a5c989ff4fc7d709298adc09733b9eeb7391facf895633e94ac5227086f0eec3f9f701af31cc08633b256f657f875a61077e20e5d39a55e1903414213eb7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,66 @@
1
+ ## Rails 7.1.5.2 (August 13, 2025) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 7.1.5.1 (December 10, 2024) ##
7
+
8
+ * No changes.
9
+
10
+
11
+ ## Rails 7.1.5 (October 30, 2024) ##
12
+
13
+ * No changes.
14
+
15
+
16
+ ## Rails 7.1.4.2 (October 23, 2024) ##
17
+
18
+ * No changes.
19
+
20
+
21
+ ## Rails 7.1.4.1 (October 15, 2024) ##
22
+
23
+ * No changes.
24
+
25
+
26
+ ## Rails 7.1.4 (August 22, 2024) ##
27
+
28
+ * Preserve `--asset-pipeline propshaft` when running `app:update`.
29
+
30
+ *Zacharias Knudsen*
31
+
32
+ * Allow string keys for SQLCommenter.
33
+
34
+ *Ngan Pham*
35
+
36
+ * Fix derived foreign key to return correctly when association id is part of query constraints.
37
+
38
+ *Varun Sharma*
39
+
40
+ * Show warning for `secret_key_base` in development too.
41
+
42
+ *fatkodima*
43
+
44
+ * Fix sanitizer vendor configuration in 7.1 defaults.
45
+
46
+ In apps where `rails-html-sanitizer` was not eagerly loaded, the sanitizer default could end up
47
+ being Rails::HTML4::Sanitizer when it should be set to `Rails::HTML5::Sanitizer`.
48
+
49
+ *Mike Dalessio*, *Rafael Mendonça França*
50
+
51
+ * Revert the use of `Concurrent.physical_processor_count` in default Puma config
52
+
53
+ While for many people this saves one config to set, for many others using
54
+ a shared hosting solution, this cause the default configuration to spawn
55
+ way more workers than reasonable.
56
+
57
+ There is unfortunately no reliable way to detect how many cores an application
58
+ can realistically use, and even then, assuming the application should use
59
+ all the machine resources is often wrong.
60
+
61
+ *Jean Boussier*
62
+
63
+
1
64
  ## Rails 7.1.3.4 (June 04, 2024) ##
2
65
 
3
66
  * No changes.
@@ -31,10 +31,22 @@ module Rails
31
31
  options[:skip_action_cable] = !defined?(ActionCable::Engine)
32
32
  options[:skip_test] = !defined?(Rails::TestUnitRailtie)
33
33
  options[:skip_system_test] = Rails.application.config.generators.system_tests.nil?
34
- options[:skip_asset_pipeline] = !defined?(Sprockets::Railtie) && !defined?(Propshaft::Railtie)
34
+ options[:asset_pipeline] = asset_pipeline
35
+ options[:skip_asset_pipeline] = asset_pipeline.nil?
35
36
  options[:skip_bootsnap] = !defined?(Bootsnap)
36
37
  options
37
38
  end
39
+
40
+ def asset_pipeline
41
+ case
42
+ when defined?(Sprockets::Railtie)
43
+ "sprockets"
44
+ when defined?(Propshaft::Railtie)
45
+ "propshaft"
46
+ else
47
+ nil
48
+ end
49
+ end
38
50
  end
39
51
  end
40
52
  end
@@ -320,14 +320,14 @@ module Rails
320
320
  action_controller.allow_deprecated_parameters_hash_equality = false
321
321
  end
322
322
 
323
- if defined?(Rails::HTML::Sanitizer) # nested ifs to avoid linter errors
324
- if respond_to?(:action_view)
325
- action_view.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
326
- end
323
+ if respond_to?(:action_view)
324
+ require "action_view/helpers"
325
+ action_view.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
326
+ end
327
327
 
328
- if respond_to?(:action_text)
329
- action_text.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
330
- end
328
+ if respond_to?(:action_text)
329
+ require "action_view/helpers"
330
+ action_text.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
331
331
  end
332
332
  else
333
333
  raise "Unknown version #{target_version.to_s.inspect}"
@@ -476,27 +476,30 @@ module Rails
476
476
  # then +credentials.secret_key_base+, and finally +secrets.secret_key_base+. For most applications,
477
477
  # the correct place to store it is in the encrypted credentials file.
478
478
  def secret_key_base
479
- if Rails.env.local? || ENV["SECRET_KEY_BASE_DUMMY"]
480
- config.secret_key_base ||= generate_local_secret
481
- else
482
- validate_secret_key_base(
483
- ENV["SECRET_KEY_BASE"] || credentials.secret_key_base || begin
484
- secret_skb = secrets_secret_key_base
485
-
486
- if secret_skb.equal?(config.secret_key_base)
487
- config.secret_key_base
488
- else
489
- Rails.deprecator.warn(<<~MSG.squish)
490
- Your `secret_key_base` is configured in `Rails.application.secrets`,
491
- which is deprecated in favor of `Rails.application.credentials` and
492
- will be removed in Rails 7.2.
493
- MSG
494
-
495
- secret_skb
479
+ config.secret_key_base ||=
480
+ if ENV["SECRET_KEY_BASE_DUMMY"]
481
+ generate_local_secret
482
+ else
483
+ validate_secret_key_base(
484
+ ENV["SECRET_KEY_BASE"] || credentials.secret_key_base || begin
485
+ secret_skb = secrets_secret_key_base
486
+
487
+ if secret_skb && secret_skb.equal?(config.secret_key_base)
488
+ config.secret_key_base
489
+ elsif secret_skb
490
+ Rails.deprecator.warn(<<~MSG.squish)
491
+ Your `secret_key_base` is configured in `Rails.application.secrets`,
492
+ which is deprecated in favor of `Rails.application.credentials` and
493
+ will be removed in Rails 7.2.
494
+ MSG
495
+
496
+ secret_skb
497
+ elsif Rails.env.local?
498
+ generate_local_secret
499
+ end
496
500
  end
497
- end
498
- )
499
- end
501
+ )
502
+ end
500
503
  end
501
504
 
502
505
  # Returns an ActiveSupport::EncryptedConfiguration instance for the
@@ -10,9 +10,11 @@ module Rails
10
10
 
11
11
  def initialize
12
12
  super
13
- @root = "#{Rails.root}/"
14
13
  add_filter do |line|
15
- line.start_with?(@root) ? line.from(@root.size) : line
14
+ # We may be called before Rails.root is assigned.
15
+ # When that happens we fallback to not truncating.
16
+ @root ||= Rails.root && "#{Rails.root}/"
17
+ @root && line.start_with?(@root) ? line.from(@root.size) : line
16
18
  end
17
19
  add_filter do |line|
18
20
  if RENDER_TEMPLATE_PATTERN.match?(line)
@@ -9,8 +9,8 @@ module Rails
9
9
  module VERSION
10
10
  MAJOR = 7
11
11
  MINOR = 1
12
- TINY = 3
13
- PRE = "4"
12
+ TINY = 5
13
+ PRE = "2"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -16,7 +16,7 @@ module Rails
16
16
  when "mysql" then ["mysql2", ["~> 0.5"]]
17
17
  when "trilogy" then ["trilogy", ["~> 2.4"]]
18
18
  when "postgresql" then ["pg", ["~> 1.1"]]
19
- when "sqlite3" then ["sqlite3", ["~> 1.4"]]
19
+ when "sqlite3" then ["sqlite3", [">= 1.4"]]
20
20
  when "oracle" then ["activerecord-oracle_enhanced-adapter", nil]
21
21
  when "sqlserver" then ["activerecord-sqlserver-adapter", nil]
22
22
  when "jdbcmysql" then ["activerecord-jdbcmysql-adapter", nil]
@@ -7,7 +7,7 @@ module Rails
7
7
  module Generators
8
8
  # Holds common methods for migrations. It assumes that migrations have the
9
9
  # [0-9]*_name format and can be used by other frameworks (like Sequel)
10
- # just by implementing the next migration version method.
10
+ # just by implementing the +next_migration_number+ method.
11
11
  module Migration
12
12
  extend ActiveSupport::Concern
13
13
  attr_reader :migration_number, :migration_file_name, :migration_class_name
@@ -46,10 +46,10 @@ module Rails
46
46
  end
47
47
 
48
48
  # Creates a migration template at the given destination. The difference
49
- # to the default template method is that the migration version is appended
49
+ # to the default template method is that the migration number is prepended
50
50
  # to the destination file name.
51
51
  #
52
- # The migration version, migration file name, migration class name are
52
+ # The migration number, migration file name, migration class name are
53
53
  # available as instance variables in the template to be rendered.
54
54
  #
55
55
  # migration_template "migration.rb", "db/migrate/add_foo_to_bar.rb"
@@ -241,7 +241,6 @@
241
241
  # this file):
242
242
  # config.active_support.cache_format_version = 7.1
243
243
 
244
-
245
244
  ###
246
245
  # Configure Action View to use HTML5 standards-compliant sanitizers when they are supported on your
247
246
  # platform.
@@ -253,7 +252,6 @@
253
252
  #++
254
253
  # Rails.application.config.action_view.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
255
254
 
256
-
257
255
  ###
258
256
  # Configure Action Text to use an HTML5 standards-compliant sanitizer when it is supported on your
259
257
  # platform.
@@ -265,14 +263,12 @@
265
263
  #++
266
264
  # Rails.application.config.action_text.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
267
265
 
268
-
269
266
  ###
270
267
  # Configure the log level used by the DebugExceptions middleware when logging
271
268
  # uncaught exceptions during requests.
272
269
  #++
273
270
  # Rails.application.config.action_dispatch.debug_exception_log_level = :error
274
271
 
275
-
276
272
  ###
277
273
  # Configure the test helpers in Action View, Action Dispatch, and rails-dom-testing to use HTML5
278
274
  # parsers.
@@ -11,13 +11,22 @@ max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
11
11
  min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
12
12
  threads min_threads_count, max_threads_count
13
13
 
14
- # Specifies that the worker count should equal the number of processors in production.
15
- if ENV["RAILS_ENV"] == "production"
16
- require "concurrent-ruby"
17
- worker_count = Integer(ENV.fetch("WEB_CONCURRENCY") { Concurrent.physical_processor_count })
18
- workers worker_count if worker_count > 1
19
- end
14
+ rails_env = ENV.fetch("RAILS_ENV") { "development" }
20
15
 
16
+ if rails_env == "production"
17
+ # If you are running more than 1 thread per process, the workers count
18
+ # should be equal to the number of processors (CPU cores) in production.
19
+ #
20
+ # It defaults to 1 because it's impossible to reliably detect how many
21
+ # CPU cores are available. Make sure to set the `WEB_CONCURRENCY` environment
22
+ # variable to match the number of processors.
23
+ worker_count = Integer(ENV.fetch("WEB_CONCURRENCY") { 1 })
24
+ if worker_count > 1
25
+ workers worker_count
26
+ else
27
+ preload_app!
28
+ end
29
+ end
21
30
  # Specifies the `worker_timeout` threshold that Puma will use to wait before
22
31
  # terminating a worker in development environments.
23
32
  worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
@@ -26,7 +35,7 @@ worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
26
35
  port ENV.fetch("PORT") { 3000 }
27
36
 
28
37
  # Specifies the `environment` that Puma will run in.
29
- environment ENV.fetch("RAILS_ENV") { "development" }
38
+ environment rails_env
30
39
 
31
40
  # Specifies the `pidfile` that Puma will use.
32
41
  pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
@@ -7,6 +7,8 @@ class Rails::InfoController < Rails::ApplicationController # :nodoc:
7
7
  prepend_view_path ActionDispatch::DebugView::RESCUES_TEMPLATE_PATHS
8
8
  layout -> { request.xhr? ? false : "application" }
9
9
 
10
+ RFC2396_PARSER = defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::RFC2396_Parser.new
11
+
10
12
  before_action :require_local!
11
13
 
12
14
  def index
@@ -20,7 +22,7 @@ class Rails::InfoController < Rails::ApplicationController # :nodoc:
20
22
 
21
23
  def routes
22
24
  if query = params[:query]
23
- query = URI::DEFAULT_PARSER.escape query
25
+ query = RFC2396_PARSER.escape query
24
26
 
25
27
  render json: {
26
28
  exact: matching_routes(query: query, exact_match: true),
@@ -53,7 +55,7 @@ class Rails::InfoController < Rails::ApplicationController # :nodoc:
53
55
  match ||= (query === route_wrapper.verb)
54
56
 
55
57
  unless match
56
- controller_action = URI::DEFAULT_PARSER.escape(route_wrapper.reqs)
58
+ controller_action = RFC2396_PARSER.escape(route_wrapper.reqs)
57
59
  match = exact_match ? (query === controller_action) : controller_action.include?(query)
58
60
  end
59
61
 
data/lib/rails/railtie.rb CHANGED
@@ -50,8 +50,8 @@ module Rails
50
50
  # To add an initialization step to the \Rails boot process from your railtie, just
51
51
  # define the initialization code with the +initializer+ macro:
52
52
  #
53
- # class MyRailtie < Rails::Railtie
54
- # initializer "my_railtie.configure_rails_initialization" do
53
+ # class MyGem::Railtie < Rails::Railtie
54
+ # initializer "my_gem.configure_rails_initialization" do
55
55
  # # some initialization behavior
56
56
  # end
57
57
  # end
@@ -59,9 +59,9 @@ module Rails
59
59
  # If specified, the block can also receive the application object, in case you
60
60
  # need to access some application-specific configuration, like middleware:
61
61
  #
62
- # class MyRailtie < Rails::Railtie
63
- # initializer "my_railtie.configure_rails_initialization" do |app|
64
- # app.middleware.use MyRailtie::Middleware
62
+ # class MyGem::Railtie < Rails::Railtie
63
+ # initializer "my_gem.configure_rails_initialization" do |app|
64
+ # app.middleware.use MyGem::Middleware
65
65
  # end
66
66
  # end
67
67
  #
@@ -74,14 +74,14 @@ module Rails
74
74
  # Railties can access a config object which contains configuration shared by all
75
75
  # railties and the application:
76
76
  #
77
- # class MyRailtie < Rails::Railtie
77
+ # class MyGem::Railtie < Rails::Railtie
78
78
  # # Customize the ORM
79
- # config.app_generators.orm :my_railtie_orm
79
+ # config.app_generators.orm :my_gem_orm
80
80
  #
81
81
  # # Add a to_prepare block which is executed once in production
82
82
  # # and before each request in development.
83
83
  # config.to_prepare do
84
- # MyRailtie.setup!
84
+ # MyGem.setup!
85
85
  # end
86
86
  # end
87
87
  #
@@ -90,9 +90,9 @@ module Rails
90
90
  # If your railtie has Rake tasks, you can tell \Rails to load them through the method
91
91
  # +rake_tasks+:
92
92
  #
93
- # class MyRailtie < Rails::Railtie
93
+ # class MyGem::Railtie < Rails::Railtie
94
94
  # rake_tasks do
95
- # load "path/to/my_railtie.tasks"
95
+ # load "path/to/my_gem.tasks"
96
96
  # end
97
97
  # end
98
98
  #
@@ -100,9 +100,9 @@ module Rails
100
100
  # your generators at a different location, you can specify in your railtie a block which
101
101
  # will load them during normal generators lookup:
102
102
  #
103
- # class MyRailtie < Rails::Railtie
103
+ # class MyGem::Railtie < Rails::Railtie
104
104
  # generators do
105
- # require "path/to/my_railtie_generator"
105
+ # require "path/to/my_gem_generator"
106
106
  # end
107
107
  # end
108
108
  #
@@ -120,7 +120,7 @@ module Rails
120
120
  # this less confusing for everyone.
121
121
  # It can be used like this:
122
122
  #
123
- # class MyRailtie < Rails::Railtie
123
+ # class MyGem::Railtie < Rails::Railtie
124
124
  # server do
125
125
  # WebpackServer.start
126
126
  # end
data/lib/rails.rb CHANGED
@@ -24,7 +24,7 @@ silence_warnings do
24
24
  Encoding.default_internal = Encoding::UTF_8
25
25
  end
26
26
 
27
- # :include: railties/README.rdoc
27
+ # :include: ../README.rdoc
28
28
  module Rails
29
29
  extend ActiveSupport::Autoload
30
30
  extend ActiveSupport::Benchmarkable
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railties
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.3.4
4
+ version: 7.1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-06-04 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activesupport
@@ -16,28 +15,28 @@ dependencies:
16
15
  requirements:
17
16
  - - '='
18
17
  - !ruby/object:Gem::Version
19
- version: 7.1.3.4
18
+ version: 7.1.5.2
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - '='
25
24
  - !ruby/object:Gem::Version
26
- version: 7.1.3.4
25
+ version: 7.1.5.2
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: actionpack
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - '='
32
31
  - !ruby/object:Gem::Version
33
- version: 7.1.3.4
32
+ version: 7.1.5.2
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - '='
39
38
  - !ruby/object:Gem::Version
40
- version: 7.1.3.4
39
+ version: 7.1.5.2
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: rackup
43
42
  requirement: !ruby/object:Gem::Requirement
@@ -120,14 +119,14 @@ dependencies:
120
119
  requirements:
121
120
  - - '='
122
121
  - !ruby/object:Gem::Version
123
- version: 7.1.3.4
122
+ version: 7.1.5.2
124
123
  type: :development
125
124
  prerelease: false
126
125
  version_requirements: !ruby/object:Gem::Requirement
127
126
  requirements:
128
127
  - - '='
129
128
  - !ruby/object:Gem::Version
130
- version: 7.1.3.4
129
+ version: 7.1.5.2
131
130
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
132
131
  email: david@loudthinking.com
133
132
  executables:
@@ -459,12 +458,11 @@ licenses:
459
458
  - MIT
460
459
  metadata:
461
460
  bug_tracker_uri: https://github.com/rails/rails/issues
462
- changelog_uri: https://github.com/rails/rails/blob/v7.1.3.4/railties/CHANGELOG.md
463
- documentation_uri: https://api.rubyonrails.org/v7.1.3.4/
461
+ changelog_uri: https://github.com/rails/rails/blob/v7.1.5.2/railties/CHANGELOG.md
462
+ documentation_uri: https://api.rubyonrails.org/v7.1.5.2/
464
463
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
465
- source_code_uri: https://github.com/rails/rails/tree/v7.1.3.4/railties
464
+ source_code_uri: https://github.com/rails/rails/tree/v7.1.5.2/railties
466
465
  rubygems_mfa_required: 'true'
467
- post_install_message:
468
466
  rdoc_options:
469
467
  - "--exclude"
470
468
  - "."
@@ -481,8 +479,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
481
479
  - !ruby/object:Gem::Version
482
480
  version: '0'
483
481
  requirements: []
484
- rubygems_version: 3.3.27
485
- signing_key:
482
+ rubygems_version: 3.6.9
486
483
  specification_version: 4
487
484
  summary: Tools for creating, working with, and running Rails applications.
488
485
  test_files: []