railties 7.1.3.4 → 7.1.4.1

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: 5a713c038c0add6ec4194a1c5c48a7e2f5f82da156d84e8af357d48cbb914f0e
4
- data.tar.gz: 77a6b444181b72e1e506c8d3335fa596b1bcaf62c2adfdd3cbda2671fc104fde
3
+ metadata.gz: afcd0d723d5c655d8ca0c3d529e377448d727f8b1fb04736eab86c25f78e33a8
4
+ data.tar.gz: 93f2453510f705b11516a60195c91eba4c9dd9ed9c48b3534fd5d8ebca14ceb2
5
5
  SHA512:
6
- metadata.gz: e97b5e4b13e4d6b53ce3cd3d7fe7a586f58f5eb66b644043c7fade27354c951831b5112e99353c5b89f54ba5f9e2c5a6fc8bffe58d963acbcbd910aba55201fd
7
- data.tar.gz: 8fb0f94946b9e5b3ce9f7212a9e8c8752fb53056b45016cadb7d40cc062b07d1636d4af4f402fa9250b41796e5a7b90e954324b5c3651921919e0f064b3b03fc
6
+ metadata.gz: b22333b1485b049cf304fd5704da69624079c94d8434aa7e5d030cbee020ef0a31053fcc3310e95be2e33b7c82083880e10b0e25bf91ceafc9ef6e183959ddb0
7
+ data.tar.gz: dad22386dcb1ecc6362dcb569315996984f2ae05157532a79251406bdb177b69d07bc7005d38c2d57e9fa967017503cfc1e4d86672b6cb2a4c38f09178745f16
data/CHANGELOG.md CHANGED
@@ -1,3 +1,46 @@
1
+ ## Rails 7.1.4.1 (October 15, 2024) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 7.1.4 (August 22, 2024) ##
7
+
8
+ * Preserve `--asset-pipeline propshaft` when running `app:update`.
9
+
10
+ *Zacharias Knudsen*
11
+
12
+ * Allow string keys for SQLCommenter.
13
+
14
+ *Ngan Pham*
15
+
16
+ * Fix derived foreign key to return correctly when association id is part of query constraints.
17
+
18
+ *Varun Sharma*
19
+
20
+ * Show warning for `secret_key_base` in development too.
21
+
22
+ *fatkodima*
23
+
24
+ * Fix sanitizer vendor configuration in 7.1 defaults.
25
+
26
+ In apps where `rails-html-sanitizer` was not eagerly loaded, the sanitizer default could end up
27
+ being Rails::HTML4::Sanitizer when it should be set to `Rails::HTML5::Sanitizer`.
28
+
29
+ *Mike Dalessio*, *Rafael Mendonça França*
30
+
31
+ * Revert the use of `Concurrent.physical_processor_count` in default Puma config
32
+
33
+ While for many people this saves one config to set, for many others using
34
+ a shared hosting solution, this cause the default configuration to spawn
35
+ way more workers than reasonable.
36
+
37
+ There is unfortunately no reliable way to detect how many cores an application
38
+ can realistically use, and even then, assuming the application should use
39
+ all the machine resources is often wrong.
40
+
41
+ *Jean Boussier*
42
+
43
+
1
44
  ## Rails 7.1.3.4 (June 04, 2024) ##
2
45
 
3
46
  * 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 = 4
13
+ PRE = "1"
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" }
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,14 @@
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.4.1
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: 2024-06-04 00:00:00.000000000 Z
11
+ date: 2024-10-15 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.1.3.4
19
+ version: 7.1.4.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: 7.1.3.4
26
+ version: 7.1.4.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: 7.1.3.4
33
+ version: 7.1.4.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: 7.1.3.4
40
+ version: 7.1.4.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rackup
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -120,14 +120,14 @@ dependencies:
120
120
  requirements:
121
121
  - - '='
122
122
  - !ruby/object:Gem::Version
123
- version: 7.1.3.4
123
+ version: 7.1.4.1
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - '='
129
129
  - !ruby/object:Gem::Version
130
- version: 7.1.3.4
130
+ version: 7.1.4.1
131
131
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
132
132
  email: david@loudthinking.com
133
133
  executables:
@@ -459,12 +459,12 @@ licenses:
459
459
  - MIT
460
460
  metadata:
461
461
  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/
462
+ changelog_uri: https://github.com/rails/rails/blob/v7.1.4.1/railties/CHANGELOG.md
463
+ documentation_uri: https://api.rubyonrails.org/v7.1.4.1/
464
464
  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
465
+ source_code_uri: https://github.com/rails/rails/tree/v7.1.4.1/railties
466
466
  rubygems_mfa_required: 'true'
467
- post_install_message:
467
+ post_install_message:
468
468
  rdoc_options:
469
469
  - "--exclude"
470
470
  - "."
@@ -481,8 +481,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
481
481
  - !ruby/object:Gem::Version
482
482
  version: '0'
483
483
  requirements: []
484
- rubygems_version: 3.3.27
485
- signing_key:
484
+ rubygems_version: 3.5.16
485
+ signing_key:
486
486
  specification_version: 4
487
487
  summary: Tools for creating, working with, and running Rails applications.
488
488
  test_files: []