Commit Graph

91456 Commits

Author SHA1 Message Date
Carlos Antonio da Silva
af78e7fbf9
Merge pull request #51544 from rhiroe/doc/Updated-the-default-digest-algorithm-used-for-key-derivation-in-ActiveRocord-Encryption-to-SHA256
Update the guide reference on the default digest algorithm used
for key derivation in ActiveRecord Encryption to SHA256. [ci skip]
2024-04-11 10:50:50 -03:00
Étienne Barrié
1dc7620b9f Respond with 406 when a browser is blocked by allow_browser
RFC 9110 specifies:

	The server MUST send an Upgrade header field in a 426 response
	to indicate the required protocol(s)

https://httpwg.org/specs/rfc9110.html#status.426

Status 406 Not Acceptable is more appropriate because it indicates the
resource

	does not have a current representation that would be acceptable
	to the user agent, according to the proactive negotiation header
	fields received in the request

https://httpwg.org/specs/rfc9110.html#status.406

With the proactive negociation section mentionining:

	implicit characteristics, such as the client's network address
	or parts of the User-Agent field.

https://httpwg.org/specs/rfc9110.html#proactive.negotiation
2024-04-11 10:50:24 +02:00
Jean Boussier
93df871020
Merge pull request #51540 from vahe/lazily_load_schema_cache-docs-cmment-cleanup
Remove misleading comment related to lazily_load_schema_cache and use_schema_cache_dump
2024-04-11 08:46:44 +02:00
rhiroe
7013b96d76 [ci skip] doc: updated the default digest algorithm used for key derivation in ActiveRecord Encryption to SHA256.
https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#active-record-encryption-algorithm-changes

```ruby
irb(main):001> Rails.configuration.active_record.encryption.hash_digest_class
=> OpenSSL::Digest::SHA256
irb(main):002> ActiveRecord::Encryption.config.hash_digest_class
=> OpenSSL::Digest::SHA256
```
2024-04-11 10:34:14 +09:00
Yasuo Honda
81cbca7569
Merge pull request #51531 from fatkodima/fix-sqlite-copy-virtual-columns
Fix copying virtual columns when altering a table in sqlite3
2024-04-11 08:18:52 +09:00
Yasuo Honda
50a3bf7d61
Merge pull request #51537 from yahonda/diag_rails_nightly_391
Address `Rails::Command::HelpIntegrationTest` failure against ruby 3.4.0dev
2024-04-11 08:18:19 +09:00
Carlos Antonio da Silva
84997578c5 Use relative paths on AR basics guide [ci skip]
Most other examples follow this pattern. Plus, using a relative filepath
on the code block will now remove it when using the copy button.
2024-04-10 14:29:12 -03:00
Vahe Khachikyan
9be9a8183d
Remove misleading comment related to lazily_load_schema_cache and use_schema_cache_dump 2024-04-10 13:19:37 -04:00
Étienne Barrié
36ff424c3b Restore to: option with an implicit controller
The `:to` option for routes can once again be a String without a
controller if the controller is implicitly provided by a nesting
`controller` or `resources` call.
2024-04-10 16:47:20 +02:00
Carlos Antonio da Silva
6e551d2874
Merge pull request #51376 from notapatch/pr-form-with-update-documentation
form_helper API documentation using `article` instead of `post`.

This makes the docs clearer and more inline with the guides,
while also disambiguating the `method=post` added to forms
for extra clarity.

 [ci skip]
2024-04-10 11:37:27 -03:00
notapatch
4a44b5110c form_helper documentation using article instead of post
Documentation previously uses post which is confusing as the
methods/verb is also post.

Before
<form action="/posts" method="post">

After
<form action="/articles" method="post">

Method
Worked through a new Rails app with scaffold of article
and checking the output of the HTML. Other HTML changes
make it more authentic:
/> => at the end of the input
2024-04-10 15:24:04 +01:00
Carlos Antonio da Silva
779d610a97
Merge pull request #51536 from jathayde/scrollbar-color-fix
Changing background color of scrollbar to not be red
2024-04-10 09:56:18 -03:00
Jean Boussier
41d867d5b1
Merge pull request #51525 from Shopify/aj-after-commit-return-value
Fix `ActiveJob::EnqueueAfterTransactionCommit` API
2024-04-10 11:42:18 +02:00
Yasuo Honda
ebed327344 Address Rails::Command::HelpIntegrationTest failure against ruby 3.4.0dev
This commit addresses Rails Nightly CI failure
at https://buildkite.com/rails/rails-nightly/builds/391#018ec54f-a2ef-40de-9749-6cc3ecae4ebd/1368-1376

```ruby
$ ruby -v
ruby 3.4.0dev (2024-04-09T16:29:01Z master 0107954f25) [x86_64-linux]
$ bin/test test/command/help_integration_test.rb:33
Run options: --seed 3363

F

Failure:
Rails::Command::HelpIntegrationTest#test_prints_help_via_`X:help`_command_when_running_`X`_and_`X:X`_command_is_not_defined [test/command/help_integration_test.rb:37]:
--- expected
+++ actual
@@ -1,4 +1,5 @@
-"Commands:
+"/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.4.0+0/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.5.0. Add ostruct to your Gemfile or gemspec.
+Commands:
   bin/rails dev:cache           # Toggle development mode caching on/off
   bin/rails dev:help [COMMAND]  # Describe available commands or one specific...

bin/test test/command/help_integration_test.rb:33

Finished in 0.738986s, 1.3532 runs/s, 1.3532 assertions/s.
1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
$
```

This commit can be reverted once both rack and jbuilder take care of it.

Related to
https://github.com/rack/rack/pull/2166
https://github.com/rails/jbuilder/issues/561
2024-04-10 17:57:40 +09:00
Jean Boussier
afa019835b Fix ActiveJob::EnqueueAfterTransactionCommit API
Fix: https://github.com/rails/rails/pull/51426#issuecomment-2042611790

`perform_later` is supposed to return the Job instance on success,
and `false` on error.

When the `enqueue` is automatically delayed, it's of course impossible
to predict if the actual queueing will succeed, but for backward compatibility
reasons, it's best to assume it will.

If necessary, you can hold onto the job instance and check for
`#successfully_enqueued?` after the transaction has completed.
2024-04-10 09:20:12 +02:00
John Athayde
68c6fd013e Changing background color of scrollbar to not be red 2024-04-09 19:59:03 -04:00
Carlos Antonio da Silva
61d78da043
Merge pull request #51532 from jathayde/fix_guides_dropdown_overflow
Fix fourth column issue in guides dropdown
2024-04-09 16:18:18 -03:00
Jean Boussier
773d17499a
Merge pull request #51510 from fatkodima/remove-ostruct
Remove usage of `OpenStruct`
2024-04-09 20:47:55 +02:00
John Athayde
92b65a0f7e Fix fourth column issue in guides dropdown 2024-04-09 14:47:39 -04:00
fatkodima
041de49399 Remove usage of OpenStruct 2024-04-09 21:35:08 +03:00
fatkodima
a457b121a0 Fix copying virtual columns when altering a table in sqlite3 2024-04-09 20:47:37 +03:00
Carlos Antonio da Silva
8feeab2338 Add missing ostruct require on AR test suite
Similar to 50515fb45f36dfad067adbdda9fee41fcb326ca9, make sure we
require `ostruct` where we use `OpenStruct`, to get the build back to
green, while we work to remove its usage on tests. (see #51510.)

Sample error:

```
Error:
ActiveRecord::Encryption::ConfigurableTest#test_installing_autofiltered_parameters_will_add_the_encrypted_attribute_as_a_filter_parameter_using_the_dot_notation:
NameError: uninitialized constant ActiveRecord::Encryption::ConfigurableTest::OpenStruct
    test/cases/encryption/configurable_test.rb:45:in `block in <class:ConfigurableTest>'
```
2024-04-09 13:56:02 -03:00
Carlos Antonio da Silva
1e444dd0dd
Merge pull request #51527 from p8/guides/ignore-file-path-comments-in-code-blocks
Remove example filepaths from code blocks in guides when using the copy button.

Some code examples use commented out paths for the path where the code should be written to. These paths can be ignored in the clipboard when using the "copy" button.
2024-04-09 13:10:22 -03:00
Eileen M. Uchitelle
95d3b2eb3d
Merge pull request #51517 from Shopify/composite-foreign-key-should-set-query-constraints-option
Ensure association's `foreign_key:` and `query_constraints:` options …
2024-04-09 11:36:11 -04:00
eileencodes
50515fb45f
Add more ostruct requires
`ostruct` was being implictly required by the `json` gem. But once it
was upgraded, these tests failed to initialize `OpenStruct`.

While we're trying to remove `ostruct` usage in #51510, CI is currently
failing so I'm pushing these in the mean time.
2024-04-09 11:34:44 -04:00
Petrik
56a759a22b Remove example filepaths from code blocks in guides
Some code examples use commented out paths for the path where the code
should be written to. These paths can be ignored in the clipboard when
using the "copy" button.

Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2024-04-09 17:01:29 +02:00
Nikita Vasilevsky
ac6217d6fa
Ensure association's foreign_key: and query_constraints: options behave the same 2024-04-09 14:52:17 +00:00
Petrik de Heus
d37c533139
Merge pull request #51529 from p8/guides/properyl-escape-sql-comments-in-examples
Use SQL comments for SQL code blocks in guides [ci-skip]
2024-04-09 16:44:50 +02:00
Carlos Antonio da Silva
7661c17ba8
Merge pull request #51355 from asavageiv/alan/update-docs
Replace Order with Book in "Creating Namespaced Models" section
of docs for consistency [ci skip]
2024-04-09 11:42:36 -03:00
Petrik
21ae70375c Use SQL comments for SQL code blocks in guides [ci-skip] 2024-04-09 16:41:53 +02:00
Carlos Antonio da Silva
52dfdbd11c
Merge pull request #51484 from akhilgkrishnan/fix-hover-text-decorator
Fix textdecorator specificity on hovering in guides index [ci skip]
2024-04-09 11:21:51 -03:00
Carlos Antonio da Silva
ca36a8083a
Merge pull request #51519 from duduribeiro/remove-duplicated-devcontainer-features-key
Remove duplicated features attribute on devcontainer.json.tt
2024-04-09 11:21:02 -03:00
Petrik de Heus
526d0eca7b
Merge pull request #51528 from p8/guides/properly-escape-comments-in-erb-examples
Properly escape paths in erb example code blocks in guides [ci-skip]
2024-04-09 16:20:17 +02:00
Carlos Antonio da Silva
0e3989a45c
Merge pull request #51526 from joshuay03/enqueue-after-transaction-commit-defaults-typos
Minor improvement in `enqueue_after_transaction_commit` docs
in the new framework defaults file. [ci skip]
2024-04-09 11:19:03 -03:00
Eileen M. Uchitelle
6f32c7b2e9
Merge pull request #51513 from fatkodima/create_table-force-and-if_not_exists
Raise when both `:force` and `:if_not_exists` provided to `create_table`
2024-04-09 10:14:30 -04:00
Petrik
e641b546ef Properly escape paths in erb example code blocks in guides [ci-skip] 2024-04-09 16:05:02 +02:00
Joshua Young
b0f6d77e99 Fix minor typos in enqueue_after_transaction_commit default docs 2024-04-09 23:55:35 +10:00
Cadu Ribeiro
e2333c6e80 Remove duplicated features attribute on devcontainer.json.tt 2024-04-09 10:43:24 -03:00
Ridhwana
a7e3798965
[RF-DOCS] Action View Helpers Documentation [ci-skip] (#51432)
Review and improve the Action View Helpers guide.

- Reorganize sections, in most cases moving most commonly used helpers up, grouping some of the formatting ones together
- Expand with more examples and a few new methods
- Link back to the API of each helper whenever possible
- Remove WIP

Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2024-04-09 10:21:57 -03:00
fatkodima
e8bf57894e Raise when both :force and :if_not_exists provided to create_table
Co-authored-by: Allison Phillips <aly@thanx.com>
2024-04-08 23:46:48 +03:00
Andrew Novoselac
ab17a6cec5 When generating an app with the --dev flag, mount the local rails repo in the devcontainer
This is useful for testing changes to how the devcontainer is generated, and will be necessary for creating a CI workflow for testing the devcontainer setup.
2024-04-08 15:30:04 -04:00
Akhil G Krishnan
521ca4eb5b Fix textdecorator specificity on hovering in index 2024-04-08 23:22:58 +05:30
Carlos Antonio da Silva
8ad19d9865 Minor tweaks / improvements to recent changelog/api docs [ci skip] 2024-04-08 14:48:44 -03:00
Carlos Antonio da Silva
4939f39627
Merge pull request #51512 from fatkodima/improve-cable-config-example
Improve ActionCable redis config example [skip ci]
2024-04-08 13:56:02 -03:00
Vipul A M
efd42121f8
Merge pull request #51515 from Earlopain/update-guides-default-content_types_allowed_inline
Update default value for `content_types_allowed_inline` in guides [ci-skip]
2024-04-08 10:39:20 -04:00
Earlopain
05e5d083fb
Update default value for content_types_allowed_inline in guides 2024-04-08 16:33:24 +02:00
Petrik de Heus
5a1db86b5e
Merge pull request #51514 from p8/activerecord/changelog-typos
Fix small typo's in ActiveRecord Changelog [ci-skip]
2024-04-08 16:02:49 +02:00
Petrik
79f0c6504d Fix small typo's in ActiveRecord Changelog [ci-skip] 2024-04-08 15:58:14 +02:00
Jean Boussier
3700aa90e3 Fix a typo in activerecord/CHANGELOG.md 2024-04-08 12:19:29 +02:00
fatkodima
f638b8b768 Improve ActionCable redis config example [skip ci] 2024-04-08 00:30:19 +03:00