Commit Graph

91766 Commits

Author SHA1 Message Date
Mike Hickman
c6df8baf4b Update spelling: Getting Start to Getting Started 2024-05-28 16:01:41 +01:00
Jean Boussier
fae23a37df
Merge pull request #51932 from Shopify/relation-model
Unify `Relation#klass` and `Relation#model`
2024-05-28 15:00:38 +02:00
Xavier Noria
630fc98709 Rewrite unless/else as if/else
I believe it is generally accepted that unless/else is hard to read,
too many negations.
2024-05-28 13:44:13 +02:00
Xavier Noria
2aeb322806 Let's use the delegation to the transaction manager here
`within_new_transaction` is delegated to the transaction manager. Let's remove
this explicit receiver to honor the delegation and for consistency with usage
of the also delegated `current_transaction`.
2024-05-28 13:21:10 +02:00
Jean Boussier
9f901b7350 Unify Relation#klass and Relation#model
One is the alias of the other, and have been so for a very long time.

My issue with this is that `klass` is really a bad name, and it's
very confusing when reading code to see a mix of both names being
used.

There is no point officially deprecating either, but inside
Active Record we should consistently only use one, I chose to
use `model` as it's way more descriptive in my opinion.
2024-05-28 11:24:35 +02:00
Jean Boussier
9ce4d4468e Explictly take a block in Arel add_bind
Fix: https://github.com/rails/rails/issues/51926

This prevent a false positive warning for unused blocks
on Ruby 3.4-dev.
2024-05-28 08:53:30 +02:00
Jean Boussier
407031f8b8
Merge pull request #50396 from Shopify/stricter-relation-delegation
Make the Relation -> Model delegation stricter
2024-05-28 08:47:41 +02:00
Jean Boussier
fd5bd98b34 Make the Relation -> Model delegation stricter
In https://github.com/rails/rails/pull/50395 I noticed lots of
methods are delegated from `Relation` to the model. The intent of
this code is to allow using use defined class methods like scopes.

But because of this autmated delegation it allows calling any
`ActiveRecord::Base` class method on a `Relation`, which in itself
may be desireable, however we very wastefully define the delegator
on the first call, and worse we wrap it with a global scope setter.

This also has led to bugs in the past, like https://github.com/rails/rails/pull/51776

So I think we should be more strict about it.

We can't deprecate this behavior because gems might depend on it, however we
can ban it from Active Record's own test suite to avoid regressions.
2024-05-28 08:13:23 +02:00
Rafael Mendonça França
f6918a5b5d
Merge pull request #51909 from rails/rm-release-notes
Draft of the release notes
2024-05-27 16:39:42 -04:00
Rafael Mendonça França
58883a5f8b
Merge pull request #51371 from theodorton/relation-test-readonly
Add `ActiveRecord::Relation#readonly?`
2024-05-27 16:39:30 -04:00
Rafael Mendonça França
b0efe426e7
Edit pass on 7.2 release notes 2024-05-27 19:53:04 +00:00
Theodor Tonum
d28e7c29a2 Add ActiveRecord::Relation#readonly?
Indicates whether a relation was marked readonly.
2024-05-27 21:51:04 +02:00
Rafael Mendonça França
9232363f4a
Merge pull request #51929 from Skalar/source-reflection-regression
Make source_reflection return nil when no name
2024-05-27 15:22:19 -04:00
Theodor Tonum
2364b4243d Make source_reflection return nil when no name 2024-05-27 21:08:45 +02:00
Yasuo Honda
ae3c93df0c
Merge pull request #51859 from fatkodima/fix-partial_inserts-with-identity-cpk
Fix non-partial inserts for models with composite identity primary keys
2024-05-27 21:45:29 +09:00
zzak
db932716a6
Merge pull request #51923 from wonda-tea-coffee/fix-typo-in-puma-config
Fix typo
2024-05-27 19:53:18 +09:00
wonda-tea-coffee
e71ba8f914 Fix typo 2024-05-27 18:58:28 +09:00
Yasuo Honda
a658c68093
Merge pull request #51921 from zzak/railties-sqlite-non_existent-test
Re-enable railtie non_existent sqlite3 test from #51901
2024-05-27 18:03:18 +09:00
zzak
e2adebef43
Re-enable railtie non_existent sqlite3 test from #51901 2024-05-27 17:34:17 +09:00
David Heinemeier Hansson
1b3fc3c82e
Change asset pipeline default to Propshaft in Rails 8 (#51799)
* Change asset pipeline default to Propshaft

* Use :all for stylesheets when propshaft is active

* Switch to using propshaft as the default (still need to find a way to tests against sprockets too)

* Fix tests that rely on sprockets being used

* Fix Propshaft tests (#51913)

* Update railties/test/generators/shared_generator_tests.rb

Co-authored-by: Lázaro Nixon <lazaronixon@hotmail.com>

---------

Co-authored-by: Lázaro Nixon <lazaronixon@hotmail.com>
2024-05-25 20:48:35 -07:00
Petrik de Heus
d0a3e18d4d
Merge pull request #51867 from duffuniverse/add-missed-comma-to-instrumentation-guide
[ci skip] Add a comma in the Exceptions section of Active Support Instrumentation guide
2024-05-25 23:29:21 +02:00
Xavier Noria
4cde578c0e Restore original header for browser version guards 2024-05-25 19:27:30 +02:00
Ryuta Kamizono
f114a247aa
Merge pull request #51915 from nisusam/fix_symbol
Fix `+` symbol [ci skip]
2024-05-25 18:01:14 +09:00
nisusam
9622342950 Fix + symbol [ci skip] 2024-05-25 14:22:49 +05:30
Xavier Noria
0a9d844c9a Remove backticks from jemalloc
jemalloc is the name of a project.
2024-05-25 09:42:38 +02:00
Xavier Noria
91f9d640bd Edit pass over the 7.2 release notes 2024-05-25 09:33:58 +02:00
Rafael Mendonça França
bb3da8726b
Draft of the release notes 2024-05-24 20:42:13 +00:00
Rafael Mendonça França
3ccca0cc54
Merge pull request #51121 from jamiemccarthy/jm-fix-allow-browser-versions
Fix AllowBrowser versions
2024-05-24 16:27:14 -04:00
Rafael Mendonça França
fe4617fd7e
Merge pull request #51912 from Earlopain/aj-priority
Document what higher/lower priority numbers mean in ActiveJob guide [ci skip]
2024-05-24 16:26:52 -04:00
Rafael Mendonça França
548be67bce
Merge pull request #51911 from silva96/patch-2
Fix association_basics.md
2024-05-24 16:25:30 -04:00
Earlopain
2e8c0de787
Document what higher/lower priority numbers mean in ActiveJob guide
Or rather, what they could mean. What to do with priority numbers is up to the adapter implementation.

All adapters that support priority that I know of treat lower priority as more urgent:
* Backburner
* Delayed Job
* Que
* SolidQueue
* GoodJob (in v4)
2024-05-24 22:12:06 +02:00
Benjamín Silva
25b238568c
Fix association_basics.md
In this section the relation was renamed `:writer` so we need to reflect that in the examples.
2024-05-24 16:10:22 -04:00
Rafael Mendonça França
ad41f711ce
Merge pull request #51846 from simi/base64-standard-error
Catch StandardError during Base64 decoding in message encryptor.
2024-05-24 16:00:43 -04:00
Jamie McCarthy
dc34e293e0
ActionPack: fix BrowserBlocker versions
css-nesting is not fully supported until Chrome 120, Opera 106:
https://caniuse.com/css-nesting
https://developer.mozilla.org/en-US/docs/Web/CSS/Nesting_selector#browser_compatibility
2024-05-24 19:50:05 +00:00
Rafael Mendonça França
cff6b2cd8d
Merge pull request #51874 from stiig/fix-colspan-for-rails-routes
Fix colspan for representing search results in the rails routes
2024-05-24 15:47:05 -04:00
Rafael Mendonça França
5345b04c7a
Merge pull request #51904 from akhilgkrishnan/add-railties-notable-changes-release-note--7-2
Add Railties notable changes in 7.2 release note [ci skip]
2024-05-24 14:40:10 -04:00
Akhil G Krishnan
1c0fa2f542 Add Railties notable changes in 7.2 release note 2024-05-24 23:50:30 +05:30
Carlos Antonio da Silva
942be52465 Use the railties deprecator instead of creating a new one
Add tests to verify the app and helpers files deprecation / backwards
compatibility, and remove the `.rb` extension from the message, since we
generally require without them.
2024-05-24 15:19:13 -03:00
Carlos Antonio da Silva
46cd9f7406
Merge pull request #51839 from Shopify/keep-deprecated-files
Add app.rb and helpers.rb back for backward compatibility
2024-05-24 15:04:24 -03:00
Carlos Antonio da Silva
8150212b78
Merge pull request #51907 from higher-pixels/no-doc-preview-image-needed
Mark `preview_image_needed_before_processing_variants?` as private API
2024-05-24 13:18:27 -03:00
Tom Rossi
5192f31001 Mark preview_image_needed_before_processing_variants? as private API
It looks like `preview_image_needed_before_processing_variants?` was added recently,
but it's stated as being public API.

However, it looks like it's more of an implementation detail that's not meant for Active Storage users.

So this marks it as nodoc, so we're not on the hook for maintaining it.
2024-05-24 15:09:15 +00:00
eileencodes
d189cbcb56
Revert "Merge pull request #51614 from gmcgibbon/defer_route_drawing"
This reverts commit e97db3b3957781c781a61fb01265feb2b57688bb, reversing
changes made to a27a1751cfd499f69499e943f12e3400b55a323e.

This is breaking application routes when running without eager load enabled.
2024-05-24 09:59:41 -04:00
Vasiliy Matyushin
48d7feaebd fix colspan for HtmlTableFormatter and dynamic search for routes 2024-05-24 11:49:36 +05:00
Jean Boussier
272aa3bd15
Merge pull request #51898 from flavorjones/51699-improve-store-accessor-for 2024-05-24 08:34:42 +02:00
Rafael Mendonça França
6fcba444a5
Merge pull request #51900 from zzak/csrf-nodoc
Private methods do not need :nodoc: to be private API
2024-05-23 23:42:37 -04:00
Rafael Mendonça França
13252f000c
Merge pull request #51899 from zzak/bump-rdoc
Use released version of RDoc v6.7.0
2024-05-23 23:34:56 -04:00
Yasuo Honda
21bbf5aeef
Merge pull request #51901 from zzak/sqlite-non_existent-errors
Fix railtie config test for sqlite 3.46.0
2024-05-24 08:01:11 +09:00
zzak
c30c5d77d9
Fix railtie config test for sqlite 3.46.0
Follow up to #51891

This resolves the following test failure:
https://buildkite.com/rails/rails/builds/107520#018fa76e-0408-4630-a75d-eac5caa16463/1199-1209

```
Failure:
ApplicationTests::ConfigurationTest#test_SQLite3Adapter.strict_strings_by_default_can_be_configured_via_config.active_record.sqlite3_adapter_strict_strings_by_default_in_an_initializer [test/application/configuration_test.rb:2896]:
Expected /no such column: non_existent/ to match "SQLite3::SQLException: no such column: \"non_existent\" - should this be a string literal in single-quotes?".
```

Co-authored-by: Mike Dalessio <mike.dalessio@gmail.com>
2024-05-24 07:15:20 +09:00
zzak
a0621e5946
Private methods do not need :nodoc: to be private API
Follow up to #51279

Co-authored-by: Gabriel Amaral <1706819+gabriel-amaral@users.noreply.github.com>
2024-05-24 06:56:19 +09:00
zzak
467e8fe124
Use released version of RDoc v6.7.0
Follow up to #51876

Co-authored-by: Hartley McGuire <skipkayhil@gmail.com>
2024-05-24 06:46:19 +09:00