Commit Graph

91154 Commits

Author SHA1 Message Date
Rafael Mendonça França
967fc62a94
Merge pull request #51468 from Earlopain/remove-ostruct-requires
Add `ostruct` to the gemfile
2024-04-02 16:08:51 -03:00
Jean Boussier
02f6c2913b
Merge pull request #51453 from fatkodima/active-counter-caches
Add the ability to ignore counter cache columns while they are backfilling
2024-04-02 14:04:13 +02:00
Earlopain
d902f4487e
Add ostruct to the gemfile
Ruby 3.5 will warn, 3.6 will raise.

This is a test-only dependency, framework code itself doesn't use it (enforced by RuboCop)
2024-04-02 13:09:00 +02:00
fatkodima
e79455f3d4 Add the ability to ignore counter cache columns while they are backfilling 2024-04-02 13:59:46 +03:00
Carlos Antonio da Silva
4a7c86af8f
Merge pull request #51456 from lloydk/fix-contrast
Reduce contrast of text and inline code elements [ci skip]
2024-04-01 15:45:20 -03:00
Carlos Antonio da Silva
0c1804db40 Remove guides CSS files that are generated by SCSS
They're overriding the SCSS generated files since the other assets are
copied after SCSS gets generated. Since they're generated every time
with the guides anyway, they are not meant to be saved raw. (for now, at
least)

Closes #51454

[ci skip]
2024-04-01 15:31:25 -03:00
Yasuo Honda
0033d46236
Merge pull request #51439 from CodingItWrong/libxml-ruby-fix-install-error
Bump libxml-ruby to fix build failure
2024-04-01 10:19:25 +09:00
Lloyd Kupchanko
b526f11f9d Reduce contrast of text and inline code elements.
To much contrast in dark mode can cause halation and makes
text hard to read.

The Accessible Perceptual Contrast Algorithm (APCA)[1] has
preliminary guidelines ([2]) for maximum contrast in dark mode.

The changes introduced in this PR ensure that the contrast for
text content does not exceed Lc 90 and does not exceed Lc 75 for
large text.

The background color for inline code elements was also darkened
so that there is less contrast with the surrounding text.

1. https://github.com/Myndex
2. https://github.com/Myndex/SAPC-APCA/discussions/106
2024-03-31 12:46:07 -06:00
John Athayde
ee4a371645
Guides Dark Mode fixes (#51444)
* Guides feedback fixes

@claudioduarte in https://github.com/rails/rails/discussions/51415

- [x] Make alt, shorter SVG line for mobile, add responsive style
- [x] Add side padding on footer (goes to edge on mobile, does not align on desktop)
- [x] Shrink overall height of subCol so it doesn’t overlap footer

@ivanjuric in https://github.com/rails/rails/discussions/51398

- [x] Flip inverted dark modes on “more Ruby on Rails” nav bar

DHH/Core:

- [x] Darker dark mode (Github style)
- [x] Double box on WIP call out (index.html. editable?)
- [x] NavBar bottom issue clipping on some guides (pad the content?)
- [x] Rounded corners/better appearance on select form elements in header
- [x] Black border on bottom of interstitials

* Additional UI cleanup

- [x] tightening up white space, adding Rails brand HR after intro
- [x] base fontsize to 16px from 18px;
- [x] fixing some darker dark mode issues in the last commit

* Lightening syntax highlight colors
2024-03-30 19:09:38 +01:00
Hartley McGuire
0a40f6ec09
Merge pull request #51437 from CodingItWrong/js-page-typos
Typo fixes on JS page [ci skip]
2024-03-30 12:50:06 -04:00
Jean Boussier
f9c262be8e
Merge pull request #51452 from Shopify/update-inverse-of-nil
Suggest `inverse_of: nil` instead of `false`
2024-03-30 10:08:38 +01:00
Jean Boussier
d6ec8dbc48 Suggest inverse_of: nil instead of false
Followup: https://github.com/rails/rails/pull/50883
Ref: https://github.com/rails/rails/pull/50284#issuecomment-2027722175
2024-03-30 09:53:38 +01:00
Josh Justice
fba3763b8d Fix typos on Working with JS page
Co-authored-by: Hartley McGuire <skipkayhil@gmail.com>
2024-03-29 12:55:28 -04:00
Jean Boussier
a2a870a736
Merge pull request #51447 from Shopify/backtrace-cleaner-dup
Make ActiveSupport::BacktraceCleaner copy filters and silencers on dup and clone
2024-03-29 12:22:35 +01:00
Jean Boussier
cc0f0f9c44 Make ActiveSupport::BacktraceCleaner copy filters and silencers on dup and clone
Previously the copy would still share the internal silencers and filters array,
causing state to leak.
2024-03-29 12:13:32 +01:00
Josh Justice
1641f119bd Bump libxml-ruby to fix build failure
https://github.com/xml4r/libxml-ruby/issues/213
c7933a7f84
2024-03-28 15:00:17 -04:00
Vipul A M
8e46af8c93
Merge pull request #51433 from ryo8000/fix-typo
Fixed typo in guides/README.md
2024-03-28 09:04:09 -04:00
Ryo H
63970d9b01 Fixed typo in guides/README.md 2024-03-28 21:51:23 +09:00
Jean Boussier
e5d3bacc3e
Merge pull request #51431 from fcce/fix-load_async-query_cache
Fix load_async to work with query cache
2024-03-27 13:14:06 +01:00
Feng Ce
c1c07b096b Remove delegate_missing_to in FutureResult class and add test cases. 2024-03-27 17:58:12 +08:00
Rafael Mendonça França
af773ae44a
Merge pull request #51427 from andrewn617/add-tests-for-previous-regressions
Add tests for regressions identified in rails/rails@640e3981
2024-03-26 13:52:15 -03:00
Andrew Novoselac
cd5fe84fbe Add tests guarding against regressions identified in rails/rails@640e3981
We had to revert rails/rails@6dd1929 due to some regressions it caused. Here are some tests that would prevent those regressions in the future. See previous commits for more detail.
2024-03-26 12:32:13 -04:00
Jean Boussier
12dbb80635
Merge pull request #51425 from andrewn617/revert-eliminate-lease-connection-in-type-caster-connection
Revert eliminate lease connection in type caster connection
2024-03-26 16:55:00 +01:00
Matthew Draper
530d77170e
Merge pull request #51336 from adrianna-chang-shopify/ac-retry-idempotent-queries-2
Retry known idempotent SELECT queries on connection-related exceptions
2024-03-27 01:48:15 +10:30
Andrew Novoselac
42fede57bd Use with_connection instead of lease_connection in TypeCaster::Connection 2024-03-26 10:13:49 -04:00
Andrew Novoselac
640e3981ca Revert "Eliminate lease_connection call in TypeCaster::Connection"
This reverts commit 6dd1929b04de42cdff1264bb5618c7f6abe77a9c.

This introduced a change in behaviour since type_for_attribute is aware of custom types but lookup_cast_type does not.

Additionally, since we no longer to use the table and column info to get attributes, this introduced an issue where attribute types were not be correctly found for some queries, where we were joining a table that has a different name than the name of the reflection for that association.
2024-03-26 10:08:40 -04:00
Yasuo Honda
a2d2155e0e
Merge pull request #51357 from yahonda/ruby_chilled_strings
Address `RendererTest#test_rendering_with_a_class_renderer` failure against Ruby 3.4.0dev
2024-03-26 22:45:32 +09:00
Adrianna Chang
eabcff22a8
Retry known idempotent SELECT queries on connection-related exceptions
This commit makes two types of queries retry-able by opting into our `allow_retry` flag:
1) SELECT queries we construct by walking the Arel tree via `#to_sql_and_binds`. We use a
new `retryable` attribute on collector classes, which defaults to true for most node types,
but will be set to false for non-idempotent node types (functions, SQL literals, etc). The
`retryable` value is returned from  `#to_sql_and_binds` and used by `#select_all` and
passed down the call stack, eventually reaching the adapter's `#internal_exec_query` method.

Internally-generated SQL literals are marked as retryable via a new `retryable` attribute on
`Arel::Nodes::SqlLiteral`.

2) `#find` and `#find_by` queries with known attributes. We set `allow_retry: true` in `#cached_find_by`,
and pass this down to `#find_by_sql` and `#_query_by_sql`.

These changes ensure that queries we know are safe to retry can be retried automatically.
2024-03-26 09:25:55 -04:00
Carlos Antonio da Silva
332e08d661
Minor improvements to Testing guide (#51418)
[ci skip]
2024-03-26 10:23:31 -03:00
fatkodima
e9b6185234
Merge pull request #51417 from akhilgkrishnan/test-typo-fix
Fix typo: belong_to -> belongs_to
2024-03-26 11:37:38 +02:00
Joshua Young
31ba84d5cd
Ensure binary encoding check is performed with the correct context in #encrypt_as_text (#51423) 2024-03-25 22:26:35 -07:00
Joshua Young
fc9ccbd89c
Fix ActiveRecord::Encryption::Errors::Encoding incorrectly raises for not-encrypted binary encoded values (#51412) 2024-03-25 18:05:54 -07:00
Hartley McGuire
9f4f0bbddb
Merge pull request #51422 from skipkayhil/hm-fix-actionpack-md
Regenerate some broken markdown in Action Pack [ci-skip]
2024-03-25 19:52:47 -04:00
Hartley McGuire
5df5ddc75e
Regenerate some broken markdown in Action Pack
This can be reproduced using a version of rdoc that includes this fix:
- c65266437c

The fix correctly adds a newline between definition list items, which
was not added previously.

This commit was generated with the following commands:

```
$ git checkout 3079e8b0f894e9a7e85a3bbf42383dc0a616af41 -- actionpack/lib/action_controller/metal/conditional_get.rb
$ ./tools/rdoc-to-md --only=actionpack -a
```
2024-03-25 19:39:17 -04:00
Rafael Mendonça França
41e31219da
Merge pull request #51408 from viralpraxis/add-through-to-has-many-and-has-one-association-options-list
Ensure all needed options are added to association options list unconditionally
2024-03-25 19:09:13 -03:00
Yaroslav Kurbatov
3bd2d686c7
Ensure all association options are added to the list unconditionally
Some association options, e.g. `through`, were only added to
`.valid_options` list only if they were provided. It means that
sometimes ArgumentError's message would not mention all the
possible options.
2024-03-26 00:03:45 +03:00
Steve Polito
7242fd7f5c
Conditionally skip test job in ci.yml (#51289)
Skip generating a `test` job in ci.yml when a new application is
generated with the `--skip-test` option.

Co-authored-by: Rafael Mendonça França <rafael@rubyonrails.org>
2024-03-25 13:55:20 -07:00
Rafael Mendonça França
98b3183356
Merge pull request #51390 from andrewn617/devcontainer-use-ruby-feature
Devcontainer using ruby image
2024-03-25 16:43:49 -03:00
Rafael Mendonça França
cccbedf651
Merge pull request #51393 from stevepolitodesign/sp-node-lts
Bump `NODE_LTS_VERSION` to 20.11.1
2024-03-25 15:57:22 -03:00
Lorenzo Zabot
4c3e5d2638 Minor improvements to Testing guide 2024-03-25 17:32:21 +01:00
Akhil G Krishnan
155dada1eb Fix Typo: belong_to updated to belongs_to 2024-03-25 21:25:09 +05:30
Edouard CHIN
cac6568837
Merge pull request #51389 from lxxxvi/add-documentation-for-rails-env-local-questionmark
[ci skip] Documentation for `Rails.env.local?`
2024-03-25 15:43:35 +01:00
Carlos Antonio da Silva
61a3e61e77 Minor text / error message tweaks, fixes, and punctuation
Improve a few sentences and add punctuation to some recent changelog &
guide entries.

[ci skip]
2024-03-25 10:21:08 -03:00
Jean Boussier
2ee11cd0b7 Fix a typo in automatically_invert_plural_associations documentation 2024-03-25 14:14:03 +01:00
Vipul A M
5b92bf7d34
Merge pull request #51410 from nvasilevski/add-composite-association-pk-fk-to-changelog
Add CHANGELOG entries for association composite primary and foreign keys
2024-03-25 08:53:58 -04:00
Nikita Vasilevsky
3df4d6927d Add CHANGELOG entries for association composite primary and foreign keys 2024-03-25 08:38:56 -04:00
Jean Boussier
246b3b609b
Merge pull request #50883 from Shopify/infer-inverse-of-deprecation
Put plural inverse association inference behind a configuration flag
2024-03-25 12:25:21 +01:00
Vipul A M
9e18ceeee7
Merge pull request #51414 from ronyvieira/fix-typo-on-active-record-associations-doc
Fix typo on ActiveRecord::Associations::ClassMethods doc [ci skip]
2024-03-25 06:43:36 -04:00
Rony Vieira
2f64b9d1ef Fix typo on ActiveRecord::Associations::ClassMethods doc 2024-03-25 11:36:50 +01:00
Steve Polito
0f18fe1322 Bump NODE_LTS_VERSION to 20.11.1
In e8638c9a942e94f097dc8f37a3b58ac067a5ca16 we introduced a constant to
store the version of Node to be used when generating `.node-version`.

Since then, the [current LTS][LTS] version of Node is now `20.11.1` as
of [2024-02-14][date].

[LTS]: https://nodejs.github.io/nodejs.dev/en/about/releases/
[date]: https://nodejs.org/en/blog/release/v20.11.1
2024-03-25 05:27:49 -04:00