Commit Graph

87383 Commits

Author SHA1 Message Date
Jean Boussier
bad9aa16ea
Merge pull request #48034 from shivamsinghchahar/allow-symbols-as-queue-name-in-activejob-assertions
Allow symbols as queue names in activejob test assertions
2023-04-25 21:30:17 +02:00
Jean Boussier
6ac6b0be9e
Merge pull request #48063 from miharekar/fix-nested-in-order-of
Only flatten first level to preserve nested
2023-04-25 21:27:37 +02:00
Rafael Mendonça França
3a1662f714
Merge pull request #46864 from palkan/feat/arel-function-tables
Support function table names in Arel Table
2023-04-25 14:31:16 -04:00
Rafael Mendonça França
fb4881270b
Merge PR #46843 2023-04-25 18:27:08 +00:00
Rafael Mendonça França
15a7b1ada5
Copy edits on the commit to avoid exposing this class in public API 2023-04-25 18:26:27 +00:00
Miha Rekar
ffa27f314a
Only flatten first level to preserve nested 2023-04-25 16:56:09 +02:00
Jean Boussier
2fa766d9bc
Merge pull request #48061 from Shopify/ar-execute-clear-cache
Active Record: clear query cache automatically when calling `#execute`
2023-04-25 16:46:10 +02:00
Jean Boussier
fe6876415d Get rid of AbstractMysqlAdapter#query
It is now unused.
2023-04-25 16:18:31 +02:00
Jean Boussier
e7baa9798b
Merge pull request #48062 from Shopify/trilogy-disconnect-tests
TrilogyAdapter: implement AdapterConnectionTest primitives
2023-04-25 16:02:49 +02:00
Jean Boussier
63c0d6b31b Active Record: clear query cache automatically when calling #execute
Also refactor #execute to be defined in AbstractAdapter.
2023-04-25 15:55:10 +02:00
Jean Boussier
af97f7e564 TrilogyAdapter: implement AdapterConnectionTest primitives
The tests were skipped.
2023-04-25 15:26:55 +02:00
Jean Boussier
cd100e5338
Merge pull request #48053 from fatkodima/fix-find_or_create_by-transactions
Fix `find_or_create_by`/`find_or_create_by!` when used within concurrent transactions
2023-04-25 11:58:25 +02:00
fatkodima
7130e3cfc4 Fix find_or_create_by/find_or_create_by! when used within concurrent transactions 2023-04-25 12:09:26 +03:00
Jean Boussier
611dac6305
Merge pull request #48054 from Shopify/cleanup-execute
Refactor Mysql2Adapter and TrilogyAdapter
2023-04-25 09:50:24 +02:00
Jean Boussier
eb3a17414a TrilogyAdapter: add some missing nodoc and remove a dead method 2023-04-25 09:24:34 +02:00
Jean Boussier
8e39e0def6 Extract Trilogy::DatabaseStatements
To be consistent with other adapters.
2023-04-25 09:24:34 +02:00
Jean Boussier
f902999b47 Make TrilogyAdapter #each_hash and #error_number private
They were never meant to be public.
2023-04-25 09:24:34 +02:00
Jean Boussier
f69bbcbc07 MySQL2 and TrilogyAdapter: stop using #execute as internal API
`#execute` is a public method and using it internaly forces us to expose
private arguments and other dirty things.

Other adapters don't do this, so this bring MySQL in line with others.
2023-04-25 09:24:34 +02:00
Yasuo Honda
e93bd8fde0
Merge pull request #48048 from tiramizoo/pg-1-5-warning
Fix pg 1.5.0 deprecation warning
2023-04-25 16:13:30 +09:00
Xavier Noria
08d66afcb5 Use RDoc markup 2023-04-25 08:42:20 +02:00
Wojciech Wnętrzak
f05de69c17
Fix pg 1.5 deprecation warning
Closes #48046
2023-04-25 08:39:23 +02:00
Xavier Noria
73e57e4dc5 Document query cache invalidation for raw_connection 2023-04-25 08:28:29 +02:00
Yasuo Honda
744b6715a5
Merge pull request #48040 from fatkodima/fix-deprecation-referential_integrity_test
Fix a deprecation in `referential_integrity_test.rb` file
2023-04-24 21:10:49 +09:00
Jean Boussier
77fa5584a3
Merge pull request #48015 from rails/fix-trilogy-builds-retry
Fix trilogy builds
2023-04-24 09:54:35 +02:00
Jean Boussier
5aabcba52b Delete incompatible Trilogy tests
The trilogy test suite was imported directly, but many of
the test can't work as is in Rails test suite because they were
mutating DB state.

Most are redundant anyway, or should be implemented as shared test
that are executed for all adapters.
2023-04-24 09:35:28 +02:00
Petrik de Heus
40f6c12c24
Merge pull request #48044 from p8/docs/fix-headers
Escape namespaces in some doc headers [ci-skip]
2023-04-24 09:25:00 +02:00
Petrik
f89588240f Escape namespaces in some doc headers [ci-skip]
Also move the CSP header from a method to the module.
2023-04-24 09:18:08 +02:00
Vipul A M
2c274bf472
Merge pull request #48042 from pwim/patch-2
Reword to avoid ambiguity [ci-skip]
2023-04-24 07:51:59 +05:30
Paul McMahon
2918927973
Reword to avoid ambiguity [ci-skip]
As written, it wasn't clear if each migration was run in its own transaction, or all migrations are run in a single transaction.
2023-04-24 11:18:00 +09:00
Guillermo Iguaran
3c08d359a4
Merge pull request #48036 from gareth/rfc6265-compliant-domain-all-cookies
Make Rails cookies RFC6265-compliant with domain: :all
2023-04-23 18:51:51 -07:00
Gareth Adams
8f3c6a1005 Make Rails cookies RFC6265-compliant with domain: :all
Rails has incorrectly been adding leading dots to cookie domain values
when the `domain: :all` option is present.

This leading dot was required in cookies based on [RFC 2965][rfc2965]
(October 2000), but [RFC 6265][rfc6265] (April 2011) changed that
behaviour, making a leading dot strictly incorrect. Todays browsers aim
to confirm to RFC6265 with repect to cookies.

The new behaviour is that *any* cookie with an explicitly passed domain
is sent to all matching subdomains[[ref][mdn]]. For a server to indicate
that only the exact origin server should receive the cookie, it should
instead pass *no* domain attribute.

Despite the change in behaviour, browser devtools often display a cookie
domain with a leading dot to indicate that it is valid for subdomains -
this prefixed domain is *not* necessarily the raw value that was passed
in the Set-Cookie header. This explains why it's a common belief among
developers that the leading dot is required.

RFC6265 standard gives UAs an algorithm to handle old-style cookie
domain parameters (they can drop a leading dot if present), so it's
unlikely that this error would ever have had any effect on web browsers.

However, cookies generated this way can't be processed by Ruby's own
CGI::Cookie class:

> CGI::Cookie.new "domain" => ".foo.bar", "name" => "foo"
ArgumentError: invalid domain: ".foo.bar"

Newer versions of the Ruby CGI library accomodate the same fallback
behaviour (dropping the extra dot) but this isn't a justification for it
being the right way to set a cookie.

[mdn]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#domain_attribute
[rfc2965]: https://www.rfc-editor.org/rfc/rfc2965#section-3.2
[rfc6265]: https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
2023-04-24 01:38:34 +01:00
Guillermo Iguaran
21d0ef0255
Merge pull request #48031 from zzak/av-ujs-rake-mkdir-log
Use FileUtils.mkdir_p for ujs log directory
2023-04-23 16:31:34 -07:00
fatkodima
b81e98ca44 Fix a deprecation in referential_integrity_test.rb file 2023-04-24 02:11:36 +03:00
Petrik de Heus
c5a91a3137
Merge pull request #48027 from steve-abrams/sabrams-update-postgres-doc
Add section on INCLUDE option to postgres doc [ci-skip]
2023-04-23 21:45:48 +02:00
Steven Abrams
95f4d75112 Add section on INCLUDE option to postgres doc
- Add a section to the ActiveRecord PostgreSQL doc
  describing use of the INCLUDE index option.
- Related to https://github.com/rails/rails/pull/44803
2023-04-23 13:25:49 -06:00
Petrik de Heus
719558c90f
Merge pull request #48033 from p8/docs/active-support-headers
Add missing headers to Active Support docs [ci-skip]
2023-04-23 16:10:01 +02:00
Petrik
ec28de4260 Add missing headers to Active Support docs [ci-skip]
Having a h1 heading will improve SEO and makes things look more consistent.
2023-04-23 16:02:56 +02:00
Shivam Chahar
562846ae0c Allow symbols as queue names in activejob assertions 2023-04-23 18:53:48 +05:30
zzak
04b0aab872
Use FileUtils.mkdir_p for ujs log directory 2023-04-23 18:58:12 +09:00
Xavier Noria
ea7ac1594b
Merge pull request #48030 from rails/config
Raise if setting a config key that is a method name
2023-04-23 10:38:34 +02:00
Xavier Noria
265bfad5fb Raise if setting a config key that is a method name 2023-04-23 09:39:07 +02:00
Petrik de Heus
7b376de9f2
Merge pull request #48026 from alpaca-tc/postgresql-unique-constraints-guides
Add a section on unique constraints to the AR PostgreSQL guide
2023-04-23 09:35:35 +02:00
Petrik de Heus
c396f202b0
Merge pull request #48029 from p8/docs/actionpack-headers
Cleanup Action Pack documentation headers [ci-skip]
2023-04-22 20:46:51 +02:00
Petrik de Heus
077b2c1d24
Merge pull request #48028 from p8/docs/actioncable-headers
Clean up Action Cable documentation headers [ci skip]
2023-04-22 20:46:42 +02:00
Petrik
c4f0c10157 Clean up Action Cable documentation headers [ci skip] 2023-04-22 20:40:55 +02:00
Petrik
48b205989a Cleanup Action Pack documentation headers [ci-skip] 2023-04-22 20:40:39 +02:00
alpaca-tc
5adc11c45d Add a section on unique constraints to the AR PostgreSQL guide 2023-04-22 23:10:16 +09:00
Jean Boussier
8935db5458 TrilogyAdapterTest: use the proper config 2023-04-22 16:04:32 +02:00
Petrik de Heus
f2327e8df1
Merge pull request #48024 from p8/docs/headers-active-model-types
Fix ActiveModel type headings [ci-skip]
2023-04-22 12:09:47 +02:00
Petrik de Heus
0d02e5d4c3
Merge pull request #48022 from p8/docs/fix-header-level
Fix header level for ActiveModel::Naming and DelegatedType
2023-04-22 12:08:52 +02:00