Commit Graph

87876 Commits

Author SHA1 Message Date
eileencodes
30aee98e60
Fix flaky build
These tests have `use_transcational_tests` set to false so we need to
delete the `Cpk::Book` and `Cpk::Order` in the teardown to avoid flaky
builds.
2023-06-05 15:56:26 -04:00
Rafael Mendonça França
fdb7412fce
Fix test to keep behavior the same after #48397
This test was failing because the parameter `a` in the accept header
is now being correctly extracted as a mime type.

This test was expecting that Rails would extract it an an empty accept
header, that will only happen now if the `q` parameter that has special
meaning in used.
2023-06-05 19:51:27 +00:00
Eileen M. Uchitelle
768ebf9985
Merge pull request #48385 from adrianna-chang-shopify/ac-autosave-belongs-to-destroy
Fix destroying belongs_to associations for CPK
2023-06-05 13:33:01 -04:00
Eileen M. Uchitelle
acd02a22f4
Merge pull request #48268 from TakuyaKurimoto/feature/multiple-column-ordering
Support batching using composite primary keys and multiple column ordering
2023-06-05 13:32:47 -04:00
Rafael Mendonça França
0e1800396d
Merge pull request #48397 from ThunderKey/improve-mime-regex
improve quoted parameters in mime types
2023-06-05 12:56:17 -04:00
Jean Boussier
c622a4da8b
Merge pull request #48396 from etiennebarrie/remove-github-gem-source
Remove :github gem source from template Gemfile
2023-06-05 15:46:56 +02:00
Jean Boussier
d0491b8469
Merge pull request #48395 from Shopify/as-deprecation-remove-singleton
ActiveSupport::Deprecator stop using `Singleton`
2023-06-05 15:12:34 +02:00
takuyaK
9452b59506 Support batching using composite primary keys and multiple column ordering
When find_each/find_in_batches/in_batches are performed on a table with composite primary keys, ascending or descending order can be selected for each key.

    ```ruby
    Person.find_each(order: [:desc, :asc]) do |person|
      person.party_all_night!
    end
    ```
2023-06-05 21:59:38 +09:00
Nicolas Erni
1071a39020 improve quoted parameters in mime types
Accept headers allow parameters to be passed. They can contain quotes
that need to be handled differently. These quoted strings can contain
commas, which are not considered as delimiters of accept headers.

Additionally, all parameters before the q-parameter should be used to
lookup the media-type as well. If no media-type with the parameters is
found, a fallback is introduced to the media-type without any parameters
to keep the same functionality as before.

Fix #48052
2023-06-05 12:53:08 +02:00
Étienne Barrié
e25611da82 Remove :github gem source from template Gemfile
The :github source was already supported in the oldest supported version
of Bundler, 1.15.0:

https://github.com/rubygems/bundler/blob/v1.15.0/lib/bundler/dsl.rb#L253

It now has additional features like support for pull request URLs which
the explicit Git source here breaks.
2023-06-05 11:49:58 +02:00
Jean Boussier
9812641891 ActiveSupport::Deprecator stop using Singleton
Followup: https://github.com/rails/rails/pull/47354

It does a bit more than just giving you a `.instance` method
it also change the behavior of dup and clone, we don't need
any of that, and `.instance` is deprecated anyway.
2023-06-05 08:43:37 +02:00
Guillermo Iguaran
628cdf9e9c
Merge pull request #48394 from amatsuda/i18n_1141
Revert "Switch to i18n master branch temporary to fix actionview test"
2023-06-04 17:05:47 -07:00
Akira Matsuda
341db94b22
Revert "Switch to i18n master branch temporary to fix actionview test"
This reverts commit 43f4792f16e479afb00b7fe7a9df1e4c7b26fad7.

i18n 1.14.1 is available now
2023-06-05 08:38:18 +09:00
Guillermo Iguaran
61d4bf58de Avoid duplication between PluginTestHelper and PluginHelpers, use only generate_plugin to generate plugins 2023-06-04 03:36:21 -07:00
Guillermo Iguaran
312e17ee08 Make sure the dependencies are installed for plugins generated during tests 2023-06-04 02:39:05 -07:00
Guillermo Iguaran
f618fa4bfd Fix actionview test to work regardless of capitalization of missing translation message 2023-06-03 18:51:55 -07:00
Guillermo Iguaran
43f4792f16 Switch to i18n master branch temporary to fix actionview test
Revert this commit after i18n > 1.14.0 is released.
2023-06-03 18:49:03 -07:00
Rafael Mendonça França
9d74450a0f
Merge pull request #48378 from hsbt/update-stringio
Bump up stringio-3.0.7
2023-06-02 17:12:19 -04:00
Rafael Mendonça França
bf66b75a70
Merge pull request #48373 from genebustam/patch-1
Correct directory-checking block in security.md
2023-06-02 17:09:15 -04:00
Rafael Mendonça França
80271fe5a4
Cleanup CHANGELOG of feature that will not be released 2023-06-02 21:07:24 +00:00
Rafael Mendonça França
fb919dac93
Merge pull request #47647 from fatkodima/remove_unique_key-by-options
Consider options when removing UNIQUE KEYs
2023-06-02 16:56:01 -04:00
Adrianna Chang
be231a7f22
Fix destroying belongs_to associations for CPK
This commit handles destroying CPK associations when autosave is set
and the parent association is marked for destruction. It does so
by ensuring that all parts of the foreign key (the parent's CPK)
are set to nil before destroying the parent record.
2023-06-02 15:39:33 -04:00
Eileen M. Uchitelle
f5972b442d
Merge pull request #48384 from fatkodima/fix-flaky-tests
Require missing models in ActiveRecord tests
2023-06-02 15:19:02 -04:00
fatkodima
9ee4ea980e Require missing models in ActiveRecord tests 2023-06-02 21:34:54 +03:00
Eileen M. Uchitelle
0e99d0893b
Merge pull request #48363 from gmcgibbon/has_one_autosave_cpk
Fix has_one autosaving for CPK associations
2023-06-02 12:54:09 -04:00
Gannon McGibbon
87c2ad0a81 Fix has_one autosaving for CPK associations
Adds support for autosaving has_one associations with composite primary keys.
2023-06-02 11:20:53 -05:00
Petrik de Heus
a84ef12221
Merge pull request #48383 from p8/fix/link-to-cookies
Fix link to ActionController::Cookies#cookies [ci-skip]
2023-06-02 18:13:54 +02:00
Petrik
f492d51795 Fix link to ActionController::Cookies#cookies
The `cookies` method was not defined on ActionController::Base making the
permalink to the method not work.
Changing it to ActionController::Cookies make the reference a link.
2023-06-02 16:53:38 +02:00
Jean Boussier
82916667e0
Merge pull request #48381 from Shopify/as-cache-strict-arguments
Eagerly validate pool arguments in Redis and MemCache stores
2023-06-02 16:29:59 +02:00
Jean Boussier
c07812cee2 Eagerly validate pool arguments in Redis and MemCache stores
Fix: https://github.com/rails/rails/issues/48352

While we should ensure instantiating the store doesn't immediately
attempt to connect, we should eagerly process arguments so that
if they are somehow invalid we fail early during boot rather than at
runtime.

Additionally, since it's common to get pool parameters from environment
variable, we can use `Integer` and `Float` so that string representations
are valid.
2023-06-02 16:01:09 +02:00
Petrik de Heus
5824fd941f
Merge pull request #48380 from mdh/add-request-session-documentation
Add missing docs for request.session
2023-06-02 15:31:55 +02:00
Marek de Heus
39156c8812
Update actionpack/lib/action_controller/metal.rb
Co-authored-by: Petrik de Heus <petrik@deheus.net>
2023-06-02 15:10:49 +02:00
Marek de Heus
0da0fc8979 Add missing docs for request.session 2023-06-02 15:04:21 +02:00
Eileen M. Uchitelle
254f1d8ded
Merge pull request #48357 from gmcgibbon/belongs_to_cpk
Add composite primary key validity check on belongs_to associations.
2023-06-02 08:25:16 -04:00
Hiroshi SHIBATA
891d5d68b3
Bump up stringio-3.0.7 2023-06-02 17:24:29 +09:00
Jean Boussier
5dd4dcbae3
Merge pull request #48362 from lazaronixon/fix-polymorphic-subquery
Fix polymorphic association subquery
2023-06-02 09:06:58 +02:00
Gannon McGibbon
f9a8f9c976 Add composite primary key validity check to associations.
Raise ActiveRecord::CompositePrimaryKeyMismatchError when a belongs_to,
has_one, or has_many foreign key and primary key don't have the same length.
2023-06-02 01:32:59 -05:00
Nixon
aa41938e3a Fix polymorphic association subquery 2023-06-02 02:50:23 -03:00
Rafael Mendonça França
48e4d99c75
Merge pull request #48374 from smmr0/visual
Support `VISUAL` env var, and prefer it over `EDITOR`
2023-06-01 23:55:17 -04:00
Summer ☀️
a062d182c3 Support VISUAL env var, and prefer it over EDITOR 2023-06-01 20:55:27 -06:00
Genesis Bustamante Lillo
5251fcfb36
Correct directory-checking block in security.md
This Pull Request corrects one line in a code block.

In section _File Downloads_, the block that presents a solution against malicious file downloads expects that the path to a folder named 'file' (variable `basename`) matches the path to a folder which is 3 levels above, or else, it will raise an exception:

```ruby
raise if basename != File.expand_path(File.join(File.dirname(filename), '../../../'))
```

and that is impossible. It should instead be:

```ruby
raise if basename != File.expand_path(File.dirname(filename))
```

This bug goes as far back as v2.3 of the guide. I did not look further.
2023-06-01 21:57:18 -04:00
Yasuo Honda
95af5fce71
Merge pull request #45783 from shhavel/fix/anonymous_pg_columns_of_different_type_from_json
[AR] Fix result with anonymous PG columns of different type from json
2023-06-02 08:33:08 +09:00
Guillermo Iguaran
e94999fab8
Merge pull request #48339 from natematykiewicz/activestorage_remove_attachment_empty_string
Allow an ActiveStorage attachment to be removed via a form post
2023-06-01 16:17:02 -07:00
eileencodes
a6efde6cf6
Minor changelog edits 2023-06-01 16:13:33 -04:00
Eileen M. Uchitelle
888f76de34
Merge pull request #48370 from eileencodes/revert-mysql-prepared_statements-setting
Revert deprecation message for prepared statements
2023-06-01 16:12:39 -04:00
eileencodes
2c39149e99
Revert deprecation message for prepared statements
While we had hoped to turn prepared statements on for Rails 7.2, the bug
that's preventing us from doing that is still present. See #43005.

Until this bug is fixed we should not be encouraging applications
running mysql to change the `prepared_statements` in the config to
`true`. In addition to this bug being present, Trilogy does not yet
support `prepared_statements` (although work is in progress).

It will be better to implement this deprecation when mysql2 and trilogy
can both handle `prepared_statements` without major bugs.
2023-06-01 16:11:55 -04:00
Eileen M. Uchitelle
3421e892af
Merge pull request #48241 from Shopify/populate-autoincremented-column-for-a-model-with-cpk
Assign auto populated columns on Active Record object creation
2023-06-01 16:10:36 -04:00
Guillermo Iguaran
64ab34c622
Merge pull request #48367 from ally1002/guide-back-to-top
Fixing fetch image on 'back-to-top' button
2023-06-01 12:51:00 -07:00
Jean Boussier
00c9614e2f
Merge pull request #48365 from Shopify/more-av-unparseable-template
Cleanly fallback when failing to tokenize ERB templates
2023-06-01 21:08:57 +02:00
Eileen M. Uchitelle
866df97176
Merge pull request #48369 from Shopify/test-rails-console-with-reline
Test rails console with reline
2023-06-01 14:27:33 -04:00