Commit Graph

81276 Commits

Author SHA1 Message Date
Ryuta Kamizono 5e83ad3fbd
Merge pull request #42988 from abhaynikam/fix-active-storage-test-warnings
Fixes deprecation warning logged in the test cases
2021-08-11 19:08:17 +09:00
Jean Boussier 6fce5576ea Set record_timestamps = true in AR::InternalMetadata
Fix: https://github.com/rails/rails/issues/42983

The usefulness of these timestamps is a bit questionable,
but I suppose they could be useful for debugging, and
removing them would require to ship a migration etc.

Since `record_timestamps` is now a `class_attribute` we
can simply force it to `true` in just that class.
2021-08-11 10:05:07 +02:00
Abhay Nikam 13722000ba Remove warning logged for vips variant test cases 2021-08-11 11:54:33 +05:30
Ryuta Kamizono ee98178ea5 Fix rubocop offences
https://github.com/rails/rails/runs/3294975031
2021-08-11 13:53:39 +09:00
Ryuta Kamizono 7271d5e855
Merge pull request #42987 from entretechno/simplify-pluck-value-first-to-pick-value
`ActiveRecord::InternalMetadata.[]`: Simplify `pluck(:value).first` to `pick(:value)`
2021-08-11 13:45:59 +09:00
Xavier Noria 3401139842 Move require_dependencies suite to the one for dependencies
require_dependency has now one single definition, and its implementation
does not depend on Zeitwerk or even applications. It only depends on
having some autoload paths in place.

We can test that in the AS test suite.
2021-08-11 00:12:53 +02:00
Abhay Nikam 77b7835a6a Slient the deprecation warning for ActiveStorage.replace_on_assign_to_many logged in test cases 2021-08-10 22:14:52 +05:30
Abhay Nikam c89f152d8d Slient the warning for ActiveStorage::Current.host logged in test cases 2021-08-10 21:58:01 +05:30
Jeremiah b7560426b5 Simplify `pluck(:value).first` to `pick(:value)` 2021-08-10 10:12:09 -05:00
Xavier Noria 5e8a26d705 Deletes the guide for classic mode [skip ci] 2021-08-10 12:31:21 +02:00
David Heinemeier Hansson 63a2aea2b3
rack-mini-profiler interferes with etag cache testing (#42986)
So turn it off by default, but continue to suggest it.
2021-08-10 12:28:03 +02:00
David Heinemeier Hansson adec7e7ba8
Sprockets shouldn't be in debug mode by default in development (#42984)
* Sprockets shouldn't be in debug mode by default in development

As we move to separate files with ESM, we won't be concatenating or even preprocessing large JavaScript at all. Debug mode is thus irrelevant.

* Debug mode is no longer default
2021-08-10 12:27:50 +02:00
Xavier Noria 0375657ce0 Delete the initializer `initialize_dependency_mechanism`
The concept of dependencies mechanism disappears.

We do not remove the attribute in AS::Dependencies itself here, that
class is going to have a lot of code delete later.
2021-08-10 11:48:20 +02:00
Xavier Noria 6983a89c72 Deletes the classic implementation of require_dependency 2021-08-09 17:26:51 +02:00
Kasper Timm Hansen 5422751be2
Merge pull request #42240 from keeran/keeran/query-comments
Add Marginalia to Rails, via QueryLogs
2021-08-09 16:38:37 +02:00
Keeran Raj Hawoldar 2408615154 Add QueryLogTags to Rails
Co-authored-by: Eileen M. Uchitelle <eileencodes@users.noreply.github.com>
Co-authored-by: Kasper Timm Hansen <kaspth@gmail.com>
2021-08-09 15:21:08 +01:00
Eileen M. Uchitelle 843c0a3fcd
Merge pull request #42938 from Modern-Treasury/rh/multidb-tasks
Add database specific setup and reset tasks for multidb configurations
2021-08-09 08:21:40 -04:00
Xavier Noria fc7c029467 Deletes classic test related to STI
Without classic, this test would be testing that Zeitwerk works. That
belongs to the test suite of Zeitwerk.

Active Record has the class available, whether it was already loaded or
pending autoloading, is not AR's concern.
2021-08-09 13:40:03 +02:00
Xavier Noria cd22ecbfc2 Deletes an AJ test that used classic
AJ infers adapater class names, and loads them. How are those classes made
available to AJ is a user's concern.

Perhaps they loaded the adapter with require, perhaps they have the class in the
autoload_once_paths. It does not matter, it is the user responsibility to make
the class available _somehow_, and AJ can assume that.
2021-08-09 13:39:51 +02:00
Xavier Noria 36e716cdc1 Implement support for before_remove_const in zeitwek mode
This needs Zeitwerk 2.5 for the on_unload hook.
2021-08-09 13:15:10 +02:00
Ryan Hall 0a296be9e1 Add database specific setup and reset tasks 2021-08-08 13:52:47 -07:00
John Hawthorn 6b49f33054
Merge pull request #42969 from Matt-Yorkley/tracker-tests
Create shared examples for dependency tracker tests
2021-08-08 12:36:01 -07:00
Matt-Yorkley 73b3772e49 Move dependency tracker tests shared examples
The bulk of these tests should be run using both the ERBTracker and the RipperTracker until ERBTracker is eventually removed.
2021-08-08 15:01:15 +01:00
Petrik de Heus 6828334555
Add missing dots to changelogs 2021-08-07 18:53:10 +02:00
Ryuta Kamizono c3518b4a9c Fix markup in RDoc [ci skip] 2021-08-07 17:52:33 +09:00
Ryuta Kamizono caac7313c5
Merge pull request #42965 from kamipo/fix_abstract_collector
Fix generated MIME methods to recognize kwargs
2021-08-07 14:36:28 +09:00
Ryuta Kamizono 0740772653 Fix generated MIME methods to recognize kwargs
Without this fix, generated MIME methods can't recognize kwargs:

```
% bin/test -w test/abstract/collector_test.rb:53
Running 5 tests in a single process (parallelization threshold is 50)
Run options: --seed 56716

# Running:

F

Failure:
AbstractController::Testing::TestCollector#test_generated_methods_call_custom_with_arguments_received [/Users/kamipo/src/github.com/rails/rails/actionpack/test/abstract/collector_test.rb:59]:
--- expected
+++ actual
@@ -1 +1 @@
-[#<Mime::Type:0xXXXXXX @synonyms=[], @symbol=:text, @string="text/plain", @hash=-3828881190283196326>, [:foo], {:bar=>:baz}, nil]
+[#<Mime::Type:0xXXXXXX @synonyms=[], @symbol=:text, @string="text/plain", @hash=-3828881190283196326>, [:foo, {:bar=>:baz}], {}, nil]
```
2021-08-07 13:59:08 +09:00
Ryuta Kamizono edf08301df
Merge pull request #42961 from ghiculescu/patch-4
Remove docs on multiple applications
2021-08-07 13:43:10 +09:00
Ryuta Kamizono 9576a4c77f
Merge pull request #42963 from jordannb/fix-unknown-attr-ref-err-doc
API Docs: Use Arel.sql examples that require Arel.sql
2021-08-07 13:42:45 +09:00
Ryuta Kamizono 4261e4dd85 nodoc `field_ordered_value` [ci skip] 2021-08-07 13:27:43 +09:00
Ryuta Kamizono d273d0b79d Relax version constraint in bug report templates
To prevent future PRs like #41711, #37985, #36936.
2021-08-07 13:20:26 +09:00
Ryuta Kamizono 685caef33b Fix "warning: instance variable @parallelized not initialized" 2021-08-07 13:04:31 +09:00
Breno Gazzola 77f2af34f9 Fix open redirects in active storage 2021-08-06 19:14:19 -03:00
Jordan Bostrom 18c0c568da docs: use Arel.sql examples that require Arel.sql 2021-08-06 16:58:38 -05:00
Alex Ghiculescu a86c54add1
Remove docs on multiple applications
Fixes https://github.com/rails/rails/issues/42319

Per https://github.com/rails/rails/issues/42319#issuecomment-856228851 this is not meant to be supported.
2021-08-06 16:25:20 -05:00
David Heinemeier Hansson 4a23cb3415
Output Action Cable JS without transpiling and as ESM (#42856)
* Output Action Cable JS without transpiling and as ESM

* Retain umd version under the old name, generate ESM version + duplicate under new name

* Precompile JavaScripts for direct asset pipeline use

* We've dropped support for IE11

* Include deprecation notice for the old file reference

Thanks @rafaelfranca 👍

* Allow app to opt out of precompiling actioncable js assets

cc @rafaelfranca

* Add changelog entries
2021-08-06 14:00:43 +02:00
Ryuta Kamizono 58dc8b634b
Merge pull request #42954 from kamipo/fix_per_thread_registry
Fix kwargs delegation in `PerThreadRegistry#method_missing`
2021-08-06 18:39:16 +09:00
Ryuta Kamizono e0ce6bbd6a Fix kwargs delegation in `PerThreadRegistry#method_missing`
Without this fix, the delegation will raise the ArgumentError:

```
% bin/test -w test/per_thread_registry_test.rb
Running 1 tests in a single process (parallelization threshold is 50)
Run options: --seed 23992

# Running:

E

Error:
PerThreadRegistryTest#test_method_missing_with_kwargs:
ArgumentError: wrong number of arguments (given 1, expected 0; required keyword: x)
    /Users/kamipo/src/github.com/rails/rails/activesupport/test/per_thread_registry_test.rb:9:in `foo'
    /Users/kamipo/src/github.com/rails/rails/activesupport/lib/active_support/per_thread_registry.rb:55:in `foo'
    /Users/kamipo/src/github.com/rails/rails/activesupport/lib/active_support/per_thread_registry.rb:57:in `method_missing'
    /Users/kamipo/src/github.com/rails/rails/activesupport/test/per_thread_registry_test.rb:13:in `test_method_missing_with_kwargs'
```
2021-08-06 18:24:02 +09:00
Ryuta Kamizono f9468ad191 Avoid `class_eval` 2021-08-06 18:03:33 +09:00
Ryuta Kamizono b87d8e51d4 Standardize :doc: comments [ci skip] 2021-08-06 17:10:45 +09:00
Ryuta Kamizono 6e7e8128d2 Fix markup in RDoc [ci skip] 2021-08-06 16:24:03 +09:00
Ryuta Kamizono 1eaa0f8707 Fix the `variable` link in `active_storage_overview.md` [ci skip] 2021-08-06 16:16:48 +09:00
Rafael França c50721b88b
Merge pull request #42916 from Alexander-Blair/respect-log-arguments-setting-in-application-jobs
Avoid logging delayed job arguments if log_arguments set to false
2021-08-05 23:56:03 -04:00
Rafael França 207da352dd
Merge pull request #42913 from ghiculescu/deprecation-opt-out
Allow entirely opting out of deprecation warnings
2021-08-05 23:52:41 -04:00
Rafael Mendonça França 549ef603ad
Fix indentation 2021-08-06 03:41:59 +00:00
Rafael Mendonça França 8c5badec99
Update yarn.lock 2021-08-06 03:41:31 +00:00
Rafael França e2e74cf93a
Merge pull request #39723 from hahmed/db/friendly-error-when-no-db
Create database via UI when ActiveRecord::NoDatabaseError
2021-08-05 23:41:17 -04:00
Rafael França 0c93edd244
Merge pull request #42940 from SkipKayhil/engine-migration-newline
Move comment after newline in installed migrations
2021-08-05 23:30:06 -04:00
Tom Prats fcc46228c6 Squashed commit of the following:
commit 1dca99ad4f8082d8daaa17c6600f3036c25f8e50
Author: Tom Prats <tprats108@gmail.com>
Date:   Thu Aug 5 18:07:00 2021 -0400

    Moved header

commit 62201870ff5c4124d90912989745819b05d94516
Merge: 5fa3ecae74 c91a8135c7
Author: Tom Prats <tprats108@gmail.com>
Date:   Thu Aug 5 14:41:22 2021 -0400

    Merge branch 'main' into active-storage-byte-range

commit 5fa3ecae745b4f7c67a6b6b1b7ec420877c96fb8
Author: Tom Prats <tprats108@gmail.com>
Date:   Thu Aug 5 14:39:53 2021 -0400

    Apply suggestions from code review

    Syntax updates

    Co-authored-by: Rafael França <rafael@franca.dev>

commit b9553e3698a7af5105171f9d63bd7b89cbb7e2c3
Author: Tom Prats <tprats108@gmail.com>
Date:   Wed Jun 23 17:36:26 2021 -0400

    Added Active Storage support for byte ranges
2021-08-05 18:12:07 -04:00
Eileen M. Uchitelle 7f5ebc4b43
Merge pull request #42926 from FestaLab/activestorage/implicit-transformations
Document Active Storage implicit transformations [ci-skip]
2021-08-05 15:32:16 -04:00