Commit Graph

90056 Commits

Author SHA1 Message Date
Hartley McGuire 0a67279c32
Merge pull request #50374 from euglena1215/fix-contributing-template-link
Replace outdated links with correct links
2023-12-17 00:08:54 -05:00
Teppei Shintani 6be1c14c5c Replace outdated links with correct links
The changes to 860ab28ff5 have merged the bug report templates into one.
Since the template for the main branch has been removed, the link that was previously in CONTRIBUTING.md is invalid.

So I replaced them with the changed links.
2023-12-17 13:39:05 +09:00
Jean Boussier 32afa64e17
Merge pull request #49986 from seanpdoyle/action-view-bug-report-templates
Add `actionview` bug report template
2023-12-16 19:33:31 +01:00
Sean Doyle fe2632f340 Add `actionview` bug report template
Introduce Action View bug report template for contributors to reproduce
issues with failing `ActionView::TestCase` instances.

In addition to rendering ERB with the `inline:` keyword, the sample
tests also include a `Helpers` module to demonstrate how to incorporate
view helpers into the reproduction script.
2023-12-16 10:16:10 -05:00
Jean Boussier 860ab28ff5
Merge pull request #50317 from zzak/consolidate-bug_reports
Consolidate bug_report_templates and remove the gem versions
2023-12-16 13:55:26 +01:00
Petrik de Heus 4876fbd007
Merge pull request #50365 from mkasberg/action-mailer-guide
Document `action_mailer.file_settings` [ci-skip]
2023-12-16 12:46:09 +01:00
Mike Kasberg 6fda7ade58 Document `action_mailer.file_settings` [ci-skip]
I was reading the Action Mailer guide and noticed the settings and
defaults for the `:file` delivery method were poorly documented. These
docs were originally added back in #13728. #44422 added links to the
relevant sections of the Configuration guide, but did not link
`config.action_mailer.file_settings` because the Configuration guide is
actually missing that section.

I added a short section to the Configuration guide for
`config.action_mailer.file_settings` and linked to it from the Action
Mailer guide, following the style of the other delivery methods. Like
other delivery methods, the relevant options for `file_settings` come
from the allowed options of the `Mail::FileDelivery` class in the mail
gem.

Here's where Rails sets up this delivery method with the default
location:
9064735ec5/actionmailer/lib/action_mailer/delivery_methods.rb (L30-L31)

And here's where the mail gem uses the options:
10a4443b9d/lib/mail/network/delivery_methods/file_delivery.rb (L21)
2023-12-15 08:31:07 -07:00
Jean Boussier 9064735ec5
Merge pull request #49346 from fractaledmind/ar-sqlite-virtual-columns
Add support for generated columns in SQLite3 adapter
2023-12-14 18:34:23 +01:00
Stephen Margheim 4e7bdcf93a Add support for generated columns in SQLite3 adapter
Generated columns (both stored and dynamic) are supported since version 3.31.0 of SQLite.
This adds support for those to the SQLite3 adapter.

```ruby
create_table :users do |t|
  t.string :name
  t.virtual :name_upper, type: :string, as: 'UPPER(name)'
  t.virtual :name_lower, type: :string, as: 'LOWER(name)', stored: true
end
```
2023-12-14 18:19:02 +01:00
Jean Boussier b9cc0a2625
Merge pull request #50359 from flavorjones/serve-svg-with-compression_rebase
feature: Allow serving compressed SVG images (rebased)
2023-12-14 17:54:05 +01:00
Georg Ledermann 0fc5b06c08
Allow serving compressed SVG images
This adds `image/svg+xml` to the compressible content types
of ActionDispatch::Static

Co-authored-by: Mike Dalessio <mike.dalessio@gmail.com>
2023-12-14 11:38:07 -05:00
Jean Boussier 9517841bc3
Merge pull request #50334 from yykamei/add_doc_for_assert_queries
Add doc for `assert_queries` and `assert_no_queries`
2023-12-14 16:43:15 +01:00
Jean Boussier 970126e07e
Merge pull request #50336 from fatkodima/schema_dumper-dump-global-out
Change `SchemaDumper.dump` default stream to `$stdout`
2023-12-14 16:41:23 +01:00
fatkodima fa32da934a
Merge pull request #50357 from siaw23/document_assert_no_queries_assert_queries
Document assert_queries and assert_no_queries [ci-skip]
2023-12-14 16:23:10 +02:00
Emmanuel Hayford 03f2b75417 Document assert_queries and assert_no_queries [ci-skip] 2023-12-14 15:10:53 +01:00
Jean Boussier eb32f1ec40
Merge pull request #50356 from Shopify/fix-async-none-pluck
Fix `Model.none.async_pluck` to return a Promise
2023-12-14 12:51:28 +01:00
Jean Boussier f8e842f13e Fix `Model.none.async_pluck` to return a Promise
Previously it would return a naked empty array, which is a break
of the interface.
2023-12-14 12:36:42 +01:00
Jean Boussier 5a1b2b8e50
Merge pull request #50353 from lucasmazza/lm/fix-load-async-null-relation
Fix `load_async` for null relations
2023-12-14 12:33:25 +01:00
Yutaka Kamei ccc512f6d6
Add doc for `assert_queries` and `assert_no_queries`
Follow-up to #50281

I think `assert_queries` and `assert_no_queries` are so useful that I
want to read the documentation for the assertions. This patch adds the
doc for them and updated the test case named `test_assert_queries` to
verify `:matcher` works as expected.

I also changed `assert_queries` to make sure the subscriber of
`"sql.active_record"` is unsubscribed without affecting other test
cases. Without this change, some test cases fail because of execution of
`String#match`, which may cause `ArgumentError: invalid byte sequence in UTF-8`.
2023-12-14 09:09:16 +09:00
John Hawthorn 66e5ed7fa9
Merge pull request #50352 from dustinbrownman/main
Prevent duplicate records when preloading `:has_many` association
2023-12-13 16:04:33 -08:00
Lucas Mazza c755144201
Fix `load_async` for null relations
Fixes https://github.com/rails/rails/issues/50351
2023-12-13 20:38:41 -03:00
Dustin Brown f5f48cb8a5 Prevent duplicate records when preloading has_many
When preloading a has_many association, we were simply concatenating
the preloaded records without regard to whether they were already
loaded on the owner. Even though there is a check for `loaded?` in this
part of the preloader, some persisted records may not be marked as such.
For example, if a record is created via `owner.association.create`. This
change reverts to the previous behavior of replacing the target
association while also preserving non-persisted records, which was the
goal of https://github.com/rails/rails/pull/50129.

Co-authored-by: John Hawthorn <john@hawthorn.email>
2023-12-13 21:59:53 +00:00
Jean Boussier ee65e97829 Fix a typo in a comment 2023-12-13 18:04:39 +01:00
Jean Boussier bec5cde275
Merge pull request #50349 from Shopify/trilogy-socket-conn
TrilogyAdapter: ignore host if socket is set
2023-12-13 17:54:50 +01:00
Jean Boussier 0fe087eb56 TrilogyAdapter: ignore host if socket is set
Contrary to mysql2, trilogy will ignore the `socket` config
if `host` is set.

This makes it impossible to configure a UNIX domain socket connection
via `DATABASE_URL`, as the URL must include a host.
2023-12-13 17:35:09 +01:00
Eugene Kenny 8278626a2c
Merge pull request #49297 from hannahramadan/main
Add instrumentation for ActionController::Live#send_stream
2023-12-13 08:38:59 +00:00
hramadan 6488bd9ec0 Add instrumentation for ActionController::Live#send_stream
Allows subscribing to `send_stream` events.
The event payload contains the filename, disposition, and type.
2023-12-13 08:19:48 +00:00
Edouard Chin d4bf9f3993
Merge pull request #50340 from notapatch/pr-rails_on_rack_documentation
Update Rack::Head documentation to match code behavior [ci-skip]
2023-12-13 08:38:43 +01:00
notapatch cfdf868f92 Update Rack::Head documentation to match code behavior
In commit 449039a86d,
ActionDispatch::Head was replaced with Rack::Head in the
middleware. However, the documentation was not changed.

Rack::Head code behaviour is not to change HEAD into GET it is to
close the body of all HEAD requests. This commit fixes the docs
to show this.

The left-over ActionDisplayt::Head documentation is,
unsurprisingly, wrong. Rack::Head code behaviour is not to change
HEAD into GET it is to close the body of all HEAD requests.

This commit fixes the docs to show this.
2023-12-12 21:08:56 +00:00
fatkodima 306b2fc22e Change `SchemaDumper.dump` default stream to `$stdout` 2023-12-12 16:39:22 +02:00
Hartley McGuire 5316432444
Merge pull request #50335 from takmar/fix-engines-documentation
[ci skip] Update outdated documentation for Engines
2023-12-12 00:02:14 -05:00
Yasuo Honda 9715b861ef
Merge pull request #50331 from yahonda/lock_bigdecimal_314
Lock `bigdecimal` version to 3.1.4 or lower
2023-12-12 14:01:00 +09:00
takmar ea49d27111 Update outdated documentation for Engines 2023-12-12 13:05:55 +09:00
Yasuo Honda 04ab0b58fd Lock `bigdecimal` version to 3.1.4
This commit addresses the Rails CI using Ruby master branch failure
because Rails CI enables `RAILS_STRICT_WARNINGS` to raise RuntimeError for warnings.

https://buildkite.com/rails/rails/builds/102621#018c49df-e3de-4c2f-aeb7-6d8f08997da9/1102-1107
```ruby
/rails/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb:4: warning: bigdecimal/util is found in bigdecimal, which will no longer be part of the default gems since Ruby 3.4.0. Add bigdecimal to your Gemfile or gemspec. (RuntimeError)
```

According to https://bugs.ruby-lang.org/issues/20058 ,
This failure has been triggered since cc9826503d
and it will be addressed once the bigdecimal 3.1.5 is available at rubygems.org .

In the meantime, we can workaround this issue by logking `bigdecimal` version to 3.1.4 or lower.
This commit should be reverted when the `bigdecimal` 3.1.5 is available at rubygems.org .
2023-12-12 11:45:37 +09:00
Hartley McGuire 486c50ab5e
Merge pull request #50330 from skipkayhil/hm-doc-asi-start-request
Document :request in start_processing's payload [ci-skip]
2023-12-11 19:18:04 -05:00
Hartley McGuire b41aafee6c
Document :request in start_processing's payload 2023-12-11 19:05:33 -05:00
Jean Boussier 3881518c47
Merge pull request #50281 from p8/activerecord/assert-queries
Expose `assert_queries` and `assert_no_queries` assertions
2023-12-12 00:29:45 +01:00
zzak b380da71b0
Consolidate bug_report_templates and remove the gem versions
As a contributor, changing a single line to test the desired version does not warrant a separate file for each type of report.

The only argument I can see for keeping the gem versions is that users are likely reporting a bug for a specific version of Rails, typically during an upgrade. As few people are probably testing their applications against Rails main branch.

Additionally, having the gem version templates means that we are testing both main and a stable release of Rails in CI, which has some benefit.
By removing the edge version templates, we also lose that coverage in CI, but I think it's something we can fix in buildkite-config to replace the line in those guides before running them later.

IMO, the cost of separate files and the confusion it will create if we want to add more templates outweighs the benefits mentioned here.

My motivation is that I want to add more report templates, like for additional adapters, and this list will grow to be unmanageable if we keep the gem versions.
2023-12-12 07:06:29 +09:00
fatkodima 109bb44892
Merge pull request #50328 from rimedelis/command_line
Fix typo
2023-12-11 22:20:17 +02:00
Ricardo Elisiário f9e21c5616
refactor: fix typo 2023-12-11 19:53:39 +00:00
Jean Boussier f5c6aa3349
Merge pull request #50163 from EduardoGHdez/interval-overflow-protection
Improve interval overflow protection
2023-12-11 18:51:04 +01:00
Jonathan Hefner 46d98f1fbc
Merge pull request #50276 from fusion2004/fix-read-multi-raw-with-mem-cache-store
fix LocalCache#read_multi_entries not namespacing keys & not deserializing raw values correctly
2023-12-11 11:41:18 -06:00
Jean Boussier 572f4750f1
Merge pull request #47306 from zzak/re-47129
Follow up to HTTP::Request#route_uri_pattern
2023-12-11 18:39:05 +01:00
Mark Oleson d5c7f7cc06 fix LocalCache#read_multi_entries not namespacing keys before looking them up in the cache 2023-12-11 11:25:05 -06:00
Aaron Patterson 0915a3eed8
Merge pull request #49858 from skipkayhil/hm-dont-assign-internal-variables
Prevent assigning internal ivars to AV::Base
2023-12-11 09:06:05 -08:00
Aaron Patterson 759ae9052c
Merge pull request #49472 from mateusdeap/main
[ci skip] Change `resourceful` to `resource` for clarity
2023-12-11 09:04:27 -08:00
Eileen M. Uchitelle 0745043c7a
Merge pull request #50319 from fatkodima/fix-where-for-polymorphic-cpk
Fix predicate builder for polymorphic models referencing models with composite primary keys
2023-12-11 10:20:07 -05:00
Eileen M. Uchitelle 0a6532db99
Merge pull request #50321 from fatkodima/fix-polymorphic-belongs_to-with-query_constraints
Fix polymorphic `belongs_to` to correctly use parent's `query_constraints`
2023-12-11 10:12:44 -05:00
Eileen M. Uchitelle b02ebb30a8
Merge pull request #50325 from fatkodima/fix-preloader-with-loaded-association-with-cpk
Fix `Preloader` to not generate a query for already loaded association with `query_constraints`
2023-12-11 09:28:10 -05:00
Eileen M. Uchitelle ac97750789
Merge pull request #50300 from chaadow/fix_actionmailbox_table_prefix
Take AR affixes into account for Action Mailbox database models
2023-12-11 09:24:43 -05:00