Commit Graph

91850 Commits

Author SHA1 Message Date
Jean Boussier 3b247873e2
Revert "Optimize `ActiveRecord::Relation#exists?` with no conditions for loaded relations" 2024-06-01 10:35:22 +02:00
Jean Boussier 0378b056de
Merge pull request #51966 from fatkodima/exists-and-loaded
Optimize `ActiveRecord::Relation#exists?` with no conditions for loaded relations
2024-06-01 10:26:22 +02:00
Rafael Mendonça França 64d5f8ba0e
Merge pull request #49679 from zzak/railties-quiet
🤫 Quiet down railties tests
2024-05-31 19:50:34 -04:00
Rafael Mendonça França de8f8ec9ec
Merge pull request #51980 from justinko/no-doc-actioncable-test-cookies
:nodoc: for ActionCable::Connection::TestCookies
2024-05-31 19:46:31 -04:00
Justin Ko f49ff82da2 :nodoc: for ActionCable::Connection::TestCookies 2024-05-31 17:30:03 -06:00
Rafael Mendonça França aa84eeb6f8
Depend on activestorage 8.0.0-alpha
We need to match the same behavior as the one that we are developing.
2024-05-31 23:04:54 +00:00
Rafael Mendonça França 5dd8f54741
Merge tests that are doing the same thing together
This will make sure we have less tests to run since those are slow.

Generate the app once and run many assertions on it instead of generating
the same app multiple times.
2024-06-01 07:12:09 +09:00
Rafael Mendonça França c6a980a551
Revert "Match actiontest sprockets files with the latest changes in Rails 7.2"
This reverts commit 025a83e58b.
2024-05-31 22:11:33 +00:00
zzak d350e048ce
Remove unnecessary --asset-pipeline=sprockets from app generator test
Since we are stubbing bundle commands, we can avoid sprockets side-effects here.

This commit also fixes the tests for preservation of sprockets during `app:update`.

Due to propshaft being the default, this test was unnecessary.
2024-06-01 07:11:31 +09:00
Rafael Mendonça França 3922460df7
Link should be separated by comma.
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link.
2024-05-31 22:04:38 +00:00
Rafael Mendonça França 8dc7a7fb15
Merge pull request #51975 from artfuldodger/patch-1
Clarify and make double rendering documentation consistent [ci skip]
2024-05-31 17:42:39 -04:00
Rafael Mendonça França 67c7c913c6
Merge pull request #51976 from robin850/nitpicks-tuning-perf-guide
Tiny fixes to the "Tuning Performance" guide [ci skip]
2024-05-31 17:16:38 -04:00
Rafael Mendonça França 14fbdfb7c7
Remove test for activerecord-session_store
Since 27285e7881 the special case for this gem was removed from the
codebase.

So changed this test to be about where we expect to find the
session stores.
2024-05-31 21:07:34 +00:00
Rafael Mendonça França fd81dd6252
Merge pull request #51977 from wjohnstondrip/performance-documentation-tweak
Changed dimmed to deemed, in what I assume was a typo
2024-05-31 17:05:15 -04:00
Rafael Mendonça França fe57bd2462
Lower case the `link` header
Since 1fbcf54289
the early hints will be checked against Rack::Link that requires all
headers to be lower cased.

Fixes #51961.
2024-05-31 21:00:22 +00:00
William Johnston aa1ea1b871
Changed dimmed to deemed, in what I assume was a typo 2024-05-31 15:57:12 -05:00
Rafael Mendonça França 157f1df8fb
Require `action_view/helpers` instead of `rails-html-sanitizer`
This will avoid a warning about circular dependencies.

/circular require considered harmful.*rails-html-sanitizer/

This happens because `rails-html-sanitizer` requires `action_view/helpers`
that requires `action_view/helpers/sanitize_helper` that requires
`rails-html-sanitizer`.

I'll properly fix this in rails-html-sanitizer later removing the code
that needs to be added to ActionView::Helpers in that gem.
2024-05-31 20:25:06 +00:00
Robin Dupret 78975c0267 Tiny fixes to the "Tuning Performance" guide [ci skip]
Following up #51924.
2024-05-31 21:10:38 +02:00
Rafael Mendonça França 025a83e58b
Match actiontest sprockets files with the latest changes in Rails 7.2 2024-05-31 18:55:56 +00:00
Jon Evans 625ec8301a Clarify and make double rendering documentation consistent
An action can _contain_ multiple renders/redirects, but only one can be _performed_.

"Attempting to try to" is redundant.

Also removes the `and return` recommendation in order to be consistent with the documentation updates from https://github.com/rails/rails/pull/45927
2024-05-31 12:42:44 -06:00
Rafael Mendonça França ffbc964602
Merge pull request #51974 from akhilgkrishnan/upgrade-devcontainer-ruby-image
Upgrade devcontainer to use ruby 3.3.2
2024-05-31 14:30:11 -04:00
Rafael Mendonça França 5fea59c076
Rename template folder to avoid `.` prefix
The gemspec doesn't include files with the `.` prefix, so the released
gem didn't include the devcontainer templates. This commit renames the
folder to avoid the `.` prefix, following the same pattern as all
the other `.` templates.
2024-05-31 18:25:26 +00:00
Akhil G Krishnan 5f76665023 Upgrade devcontainer to use ruby 3.3.2 2024-05-31 23:46:18 +05:30
Rafael Mendonça França f961bbfe52
Merge pull request #51973 from akhilgkrishnan/update-default-rails-file-structure
Remove .devcontainer from default rails app directory guide [ci skip]
2024-05-31 13:38:05 -04:00
Akhil G Krishnan b7d8725cd6 Remove .devcontainer from default rails app directory guide 2024-05-31 23:04:03 +05:30
zzak a2b9e92401
Document callback deduplication with regards to ActiveRecord::Transaction
/cc #51184, #51171, #40648, #48910

Co-authored-by: Rob Jonson <rob@hobbyistsoftware.com>
2024-05-31 21:12:52 +09:00
Xavier Noria dd88c7e0d2
Merge pull request #51965 from rails/fxn/trx-sql.active_record
Include the current transaction in sql.active_record event payloads
2024-05-31 13:05:57 +02:00
Xavier Noria c16d552c32 Include the current transaction in sql.active_record event payloads 2024-05-31 13:05:20 +02:00
fatkodima 6cab6744e8 Optimize `ActiveRecord::Relation#exists?` with no conditions for loaded relations 2024-05-31 14:04:34 +03:00
Jean Boussier bc56661a3d
Merge pull request #51933 from zzak/51910
Handle case where script_name is a blank string
2024-05-31 11:12:29 +02:00
Jean Boussier f6666de591
Merge pull request #51941 from Liamjen/allow_unscope_cte
Allow unscoping ActiveRecord Query CTEs
2024-05-31 11:10:36 +02:00
Jean Boussier c82c49c9aa
Merge pull request #51962 from sampatbadhe/patch-15
Add missing $ for a bash [ci skip]
2024-05-31 11:09:37 +02:00
sampatbadhe 064c605dce Add missing $ for a bash [ci skip] 2024-05-31 12:33:04 +05:30
zzak 6c7a0e891c
Change railties default log_level to :error
The default of :info generates a ton of unnecessary noise in the railties logs.
2024-05-31 10:12:07 +09:00
zzak 1d8d8e128d
Stub `rails_command` to prevent `app:template` command from being run
When #48269 was merged any gem installed during `rails new` which calls `app:template` would cause the install command to be executed and consequently `bundle install` would also run.

We want to avoid running these commands in our tests because they are very expensive.

It is up to the gem (importmap, etc) to test the behavior of the install command, not railties.

Before

```
$ bin/test test/generators/plugin_generator_test.rb test/generators/app_generator_test.rb
Finished in 320.803659s, 0.8541 runs/s, 7.1913 assertions/s.
274 runs, 2307 assertions, 14 failures, 0 errors, 0 skips
```

After

```
Finished in 70.316250s, 3.9251 runs/s, 34.3164 assertions/s.
276 runs, 2413 assertions, 0 failures, 0 errors, 0 skips
```
2024-05-31 10:12:03 +09:00
Xavier Noria 9283b9ed08 Reorder items in `transaction.active_record` docs
The `transaction.active_record` event is about transactions. Let's
first document the transaction object, then the transaction state,
and finally the connection in case you need more context.
2024-05-31 00:16:47 +02:00
Rafael Mendonça França 4e1750603e
Merge pull request #51959 from Earlopain/prism-test-parser-relax
Relax the prism test parser conditions
2024-05-30 17:57:55 -04:00
Jean Boussier ca4762eb44 Lock rails-new-docker action to Ruby 3.3.1
The 3.3.2 base image doesn't exist yet.
2024-05-30 23:39:21 +02:00
Earlopain c7c974335d
Relax the prism test parser conditions
Checking explicitly against `test` break extensions that provide their
own methods to generate tests, like `minitest-spec-rails` or `minitest-rails`.

Fixes #51956
2024-05-30 22:28:38 +02:00
Rafael Mendonça França 51b60234ad
Merge pull request #51952 from excid3/app-update-public
Update public directory during app:update command
2024-05-30 15:54:04 -04:00
Chris Oliver e360d1ee8c
Update public directory during app:update command 2024-05-30 18:52:22 +00:00
Xavier Noria ea0f0a2c96 Pass the transaction to the transaction.active_record event 2024-05-30 20:47:43 +02:00
Rafael Mendonça França 91a441b650
Merge pull request #51939 from ElMassimo/fix-broadcast-logger-compatibility
Improve compatibility for `ActiveSupport::BroadcastLogger`
2024-05-30 14:32:40 -04:00
Maximo Mussini 944bc895ca Improve compatibility between `Logger` and `ActiveSupport::BroadcastLogger`
The usage of `dispatch` in all logging methods causes common usages such
as `logger.info` to return an array of loggers, making it unsafe for an
application to upgrade to Rails 7.1.

Returning `nil` is more efficient, and is the default behavior when
using `Logger`.
2024-05-30 13:07:05 -03:00
Liamjen 07b1f2293f Allow unscoping CTEs 2024-05-30 08:15:25 -07:00
Jean Boussier 5c96860a3e
Merge pull request #51947 from zzak/rdoc-lease_connection-link 2024-05-30 13:58:20 +02:00
Xavier Noria 23df2aabbe Lazily generate a UUID for AR transactions 2024-05-30 13:51:17 +02:00
zzak 029d7a25b0
Fix link to ConnectionHandling#lease_connection from ConnectionPool docs 2024-05-30 18:41:29 +09:00
Rafael Mendonça França 1e026dbf50
Merge pull request #51945 from artfuldodger/patch-1
Switch example editor to code instead of mate
2024-05-30 02:17:36 -04:00
Jon Evans b7f7b0cb2f
Switch example editor to code instead of mate
It's been almost 10 years since the last TextMate update. 😢

I've seen developers be confused here - "huh, what's mate?" - and while I do not want to be seen as advocating for a particular editor, I would bet that more developers are on VS Code than are still holding on to TextMate.
2024-05-29 19:56:25 -06:00