Commit Graph

90378 Commits

Author SHA1 Message Date
Jean Boussier fc75fed35a
Merge pull request #50670 from byroot/active-support-after-fork-check
Get rid of `ForkTracker.check!`
2024-01-09 13:20:39 +01:00
Yasuo Honda df943c8f7c
Merge pull request #50432 from fatkodima/better-docs-for-add_exclusion_constraint
Document missing `:using` and `:where` options for `add_exclusion_constraint` [skip ci]
2024-01-09 19:55:37 +09:00
Jean Boussier a3d05309aa Get rid of `ForkTracker.check!`
Now that we require Ruby 3.1, we can assume `Process._fork` is
defined on MRI, hence we can trust that our decorator will
reliably detect forks so we no longer need to check the if
the pid changed in critical spots.
2024-01-09 11:18:38 +01:00
Rafael Mendonça França 84f773f9d1
Merge pull request #50622 from seanpdoyle/document-render-in-examples
Document rendering `:renderable` and `#render_in`
2024-01-08 16:51:39 -05:00
Rafael Mendonça França e71ebfaa8c
Merge pull request #50636 from TangRufus/setup-bun-in-ci
Add `oven-sh/setup-bun` to GitHub CI when generating an app with bun
2024-01-08 16:04:55 -05:00
Rafael Mendonça França c003ed7c69
Merge pull request #50655 from Earlopain/enable-lint-safe-navigation-chain
Enable `Lint/SafeNavigationChain` rubocop cop
2024-01-08 14:51:18 -05:00
TangRufus 4c5b6008ba
Add `oven-sh/setup-bun` to GitHub CI when generating an app with bun 2024-01-08 19:50:21 +00:00
Rafael Mendonça França 082f269974
Merge pull request #50639 from Earlopain/enable-style-array-intersect
Enable `Style/ArrayIntersect` rubocop cop
2024-01-08 14:49:20 -05:00
Hans Schnedlitz 482330d156
Do not generate pidfile in production environments (#50644)
* Remove pidfile in production

* Update changelog

* Update activestorage/test/dummy/config/puma.rb

Co-authored-by: Rafael Mendonça França <rafael@franca.dev>

* Update template and other dummy files

---------

Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
2024-01-08 14:47:25 -05:00
Rafael Mendonça França 7051c482e9
Merge pull request #50656 from skipkayhil/hm-dont-require-bisect
Do not automatically require minitest-bisect
2024-01-08 14:45:16 -05:00
Earlopain 0a9dcb0d20
Enable `Lint/SafeNavigationChain` rubocop cop 2024-01-08 20:14:58 +01:00
Aaron Patterson fa84182ebe
Merge pull request #50653 from rails/reset-super
Reset `@target` in subclasses
2024-01-08 10:56:12 -08:00
Rafael Mendonça França 5cd66b3cce
Merge pull request #50647 from igor-alexandrov/stricter_brakeman
Made Brakeman CI config stricter
2024-01-08 13:55:53 -05:00
Jean Boussier c5949ab458
Merge pull request #50648 from byroot/opt-stringify-keys
Optimize Hash#stringify_keys
2024-01-08 19:54:58 +01:00
Hartley McGuire fd7e235789
Do not automatically require minitest-bisect
This is currently causing an issue in 6-1-stable CI due to a chain of
dependencies: minitest-bisect -> minitest-server -> drb. The last
working version of Drb for Ruby 2.5 and 2.6 includes usage of
ruby2_keywords but does not declare a dependency on the shim gem
(meaning that version of Drb actual does not work on those Ruby
versions).

ruby2_keywords was [added][1] to the 6-1-stable Active Support gemspec
to address the issue with Drb, but this only fixes cases where Drb is
required by Rails. However, there are still failing tests on 6-1-stable
due to Drb being loaded in integration tests where a dummy Rails
application calls Bundler.require and the above dependency chain is
required.

To address those test failures, this commit prevents minitest-bisect
from being automatically required when the whole bundle is required. It
is not strictly necessary for main or any stable branches other than
6-1-stable, but it seems more correct since minitest_bisect is ran as an
external command anyways.

[1]: 5a54e2f36a
2024-01-08 13:42:06 -05:00
Jean Boussier 8c7e69b79b Optimize Hash#stringify_keys
Using Symbol#name allows to hit two birds with one stone.

First it will return a pre-existing string, so will save
one allocation per key.

Second, that string will be already interned, so it will
save the internal `Hash` implementation the work of looking
up the interned strings table to deduplicate the key.

```
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin21]
Warming up --------------------------------------
                to_s    17.768k i/100ms
                cond    23.703k i/100ms
Calculating -------------------------------------
                to_s    169.830k (±10.4%) i/s -    852.864k in   5.088377s
                cond    236.803k (± 7.9%) i/s -      1.185M in   5.040945s

Comparison:
                to_s:   169830.3 i/s
                cond:   236803.4 i/s - 1.39x  faster
```

```ruby
require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'
  gem 'benchmark-ips', require: false
end

HASH = {
  first_name: nil,
  last_name: nil,
  country: nil,
  profession: nil,
  language: nil,
  hobby: nil,
  pet: nil,
  longer_name: nil,
  occupation: nil,
  mailing_address: nil,
}.freeze

require 'benchmark/ips'

Benchmark.ips do |x|
  x.report("to_s") { HASH.transform_keys(&:to_s) }
  x.report("cond") { HASH.transform_keys { |k| Symbol === k ? k.name : k.to_s } }
  x.compare!(order: :baseline)
end
```
2024-01-08 19:19:20 +01:00
Aaron Patterson e30fc4abf7
Reset `@target` in subclasses
Collection associations point to an array target, where singular
associations will point to a single object. An "empty" (or "reset")
association has different meaning depending on whether it's single or a
collection. This commit changes the reset method to be specific to the
type of association.

This is related to #48671
2024-01-08 10:10:01 -08:00
Petrik de Heus 0b04c15147
Merge pull request #50593 from p8/guides/add-english-and-oxford-comma-to-wording
Move "English" and "Oxford Comma" sections under "Wording" [ci-skip]
2024-01-08 19:04:47 +01:00
Igor Alexandrov 34aca28757 Moved --no-pager exec option to CI only config 2024-01-08 21:18:00 +04:00
Rafael Mendonça França b6a0fd8087
Merge pull request #50627 from koya1616/delete-fixed-FIXME
Delete FIXME annotation in dispatch/mapper_test.rb
2024-01-08 12:17:17 -05:00
Igor Alexandrov 0550b02c63 Made Brakeman CI config stricter 2024-01-08 21:14:29 +04:00
Rafael Mendonça França 697319f06d
Merge pull request #50642 from Earlopain/remove-uri-rb-exception
Remove core_ext/uri.rb exception
2024-01-08 11:34:15 -05:00
Rafael Mendonça França dfa400b10c
Merge pull request #50640 from Earlopain/bump-libxml-ruby
Bump libxml-ruby
2024-01-08 11:33:40 -05:00
Rafael Mendonça França e940cab5e1
Merge pull request #50638 from dwightwatson/route_defined_bug
Fix undefined method issue in test
2024-01-08 11:31:16 -05:00
fatkodima ee169e389e
Merge pull request #50643 from igor-alexandrov/remove_references_to_separate_test_case_templates
Removed references to separate test case templates [ci skip]
2024-01-08 16:51:27 +02:00
Igor Alexandrov ef84e8a949 Removed references to separate test case templates due to the fact, that these templates were merged. 2024-01-08 15:32:31 +04:00
Earlopain d96c424fab
Remove core_ext/uri.rb exception
The file was removed in da8e6f6175
2024-01-08 10:58:39 +01:00
Petrik de Heus 0c9d50b9b5
Merge pull request #50635 from ghiculescu/connection-pool-docs
Minor improvements to Connection Pool docs
2024-01-08 09:56:49 +01:00
Earlopain 46021105c7
Bump libxml-ruby
This fixes bundle install when using libxml2 2.12.0
2024-01-08 09:34:11 +01:00
Earlopain 97398e4a7d
Enable `Style/ArrayIntersect` rubocop cop 2024-01-08 09:21:53 +01:00
Dwight Watson e358953660 Add missing & 2024-01-08 16:19:19 +11:00
Alex b04c512776 Minor improvements to Connection Pool docs 2024-01-08 09:59:30 +10:00
Jonathan Hefner 3bbf21c343 Use verb form of "fallback"
"Fallback" is a noun, whereas "fall back" is a verb.
2024-01-07 17:27:23 -06:00
Jonathan Hefner ff9b62417f Prepend `$` to example CLI commands [ci-skip]
This allows the syntax highlighter to recognize the code as CLI commands.
2024-01-07 17:27:23 -06:00
Jonathan Hefner 5cc2f8af3b Autolink AV::Helpers::SanitizeHelper#sanitize [ci-skip] 2024-01-07 17:27:23 -06:00
Jonathan Hefner e8656f8c28 Clean up AV::Helpers::SanitizeHelper#sanitize doc [ci-skip] 2024-01-07 17:27:23 -06:00
Jonathan Hefner d1411b2018 Split up code blocks for multi-file examples [ci-skip]
RDoc treats consecutive indented lines as a single code block.  For code
examples that span multiple files / languages, this confuses the syntax
highlighter and makes the examples harder to read.  Unfortunately, RDoc
doesn't provide syntax to prevent this, and it ignores multiple
consecutive blank lines.  However, by inserting an empty tag such as
`<code></code>`, we can force RDoc to recognize separate code blocks.
2024-01-07 17:27:23 -06:00
Jean Boussier c0b5052d92
Merge pull request #50609 from ricardotk002/use-array-intersect
Replace usage of `Array#?` with `Array#intersect?` for efficiency
2024-01-07 21:15:56 +01:00
Jean Boussier 9090ec2c84
Merge pull request #50612 from sato11/use-the-article-an-for-sql
Use the article "an" for "SQL"
2024-01-07 21:11:17 +01:00
Jean Boussier 7060d68e9c
Merge pull request #50634 from fatkodima/fix-view-runtime-with-async-queries
Fix view runtime for controllers with async queries
2024-01-07 21:06:50 +01:00
Jean Boussier 9c712f8e3a
Merge pull request #50470 from seanpdoyle/object-with-block-argument
Yield instance to `Object#with` block
2024-01-07 21:06:02 +01:00
Sean Doyle 9e64b13d8a Yield instance to `Object#with` block
The introduction of the block argument means that `Object#with` can now
accept a `Symbol#to_proc` as the block argument:

```ruby
client.with(timeout: 5_000) do |c|
  c.get("/commits")
end
```
2024-01-07 20:56:33 +01:00
Jean Boussier cbeafdf1ec
Merge pull request #50625 from akhilgkrishnan/bump-ruby-3-3-to-workflow
Use Ruby 3.3 for github workflows
2024-01-07 20:40:17 +01:00
fatkodima 339753c5b5 Fix view runtime for controllers with async queries 2024-01-07 21:31:12 +02:00
Hartley McGuire 7f341134ca
Merge pull request #50631 from skipkayhil/hm-link-bundler-io
Update link for creating a gem [ci-skip]
2024-01-07 12:48:40 -05:00
Hartley McGuire 9e8132621e
Merge pull request #50630 from skipkayhil/hm-doc-branch-renames
Fix links to master branches renamed to main [ci-skip]
2024-01-07 12:45:40 -05:00
Hartley McGuire 22c79cb464
Update link for creating a gem
[The old link points to this new page][1]

[1]: eaaf139b44
2024-01-07 12:38:55 -05:00
Hartley McGuire 580e1d621a
Fix links to master branches renamed to main
We recently had [two][1] [PRs][2] to update these types of links, so
this commit does all of the rest (remaining links to master branches
were checked and still exist).

[1]: e76c52a939
[2]: a2ed3437e3
2024-01-07 12:35:46 -05:00
David Heinemeier Hansson 0ecbb16939
Add default svg icon in generated application layout (#50629)
* SVG icon is support by Chrome/Firefox

So prefer that over PNG.

* Also included

* No need for a size when we only have one
2024-01-07 12:32:43 -05:00
Achmad Chun Chun d89fb56695
Use existing bundle path that already declared (#50615) 2024-01-07 12:30:51 -05:00