Commit Graph

74209 Commits

Author SHA1 Message Date
Rafael Mendonça França
891ac4e2f1 Add entry about the classic autoload to the upgrading guide
Talk about the thread-safe concerns of the classic autoloader in
development.
2019-08-15 19:12:39 -04:00
Rafael França
9ad68a4cf1
Merge pull request #36803 from andrewkress/fix-issue-36799
read webpacker config to populate autoload paths
2019-08-15 18:53:47 -04:00
Rafael Mendonça França
b5a52ad55b Fix the test to check for the right config 2019-08-15 18:39:46 -04:00
Ryuta Kamizono
12e2013c27
Merge pull request #36932 from kirs/mysql2-filsort-abort
Improve MySQL error detection
2019-08-16 06:46:26 +09:00
George Claghorn
836eb915b1 Fix attaching many uploaded files one at a time
Closes #36806.
2019-08-15 16:36:34 -04:00
Kir Shatrov
c99c572d37 Improve detection of ActiveRecord::StatementTimeout with mysql2 adapter
in the edge case when the query is terminated by MySQL server during filesort.
See https://bugs.mysql.com/bug.php?id=96537 for more details.
2019-08-15 21:00:07 +01:00
John Hawthorn
f61542c3f6
Merge pull request #36937 from jhawthorn/fix_tests_no_tty
Allow tests to run without a TTY
2019-08-15 09:55:56 -07:00
Ryuta Kamizono
a4158e59aa
Merge pull request #36943 from koic/bump_rubocop_to_0_74_0
Bump RuboCop to 0.74.0
2019-08-15 23:50:20 +09:00
Koichi ITO
1c66e047f6 Bump RuboCop to 0.74.0
### Summary

RuboCop 0.74.0 has been released.
https://github.com/rubocop-hq/rubocop/releases/tag/v0.74.0

And rubocop-0-74 channel is available in Code Climate.
https://github.com/codeclimate/codeclimate/releases/tag/v0.85.5

This PR specifies the same RuboCop Performance (1.3.0) and RuboCop Rails (2.0.0)
versions as Code Climate's Gemfile.lock.
https://github.com/codeclimate/codeclimate-rubocop/blob/channel/rubocop-0-74/Gemfile.lock#L51-L55

Also, the `EnforcedStyle` of `Layout/IndentationConsistency` has been renamed
from `EnforcedStyle: rails` to `EnforcedStyle: indented_internal_methods`

- https://github.com/rubocop-hq/rubocop/pull/7113
- https://github.com/rubocop-hq/rubocop/pull/7163

And this commit disables `Layout/SpaceAroundOperators`
that was changed from RuboCop 0.74 by rubocop-hq/rubocop#7211.

cf. https://github.com/rails/rails/pull/36943#issuecomment-521659529
2019-08-15 23:28:06 +09:00
Javan Makhmali
55311b1596 Ensure @rails/actioncable package contains complete source
Action Cable's JavaScript library can optionally be imported as an ES6 module via `import { … } from "@rails/actioncable/src"`, but that module is broken in most of the releases published on npm:

```
ERROR in ./node_modules/@rails/actioncable/src/connection.js
Module not found: Error: Can't resolve './internal' in './node_modules/@rails/actioncable/src'
 @ ./node_modules/@rails/actioncable/src/connection.js
 @ ./node_modules/@rails/actioncable/src/index.js
```

Because `internal.js` was gitignored, it would only be included if the publisher happened to have it generated locally. Committing it to version control ensures that won't happen, and gives us better visibility into changes over time.

References:
- https://github.com/rails/rails/pull/34370
- c0368ad090b79c19300a4aa133bb188b2d9ab611
2019-08-15 09:19:59 -04:00
John Hawthorn
79953c476c Allow tests to run without a TTY
We had two tests which assigned IO.console.winsize (to ensure output was
consistent), however it's possible for IO.console to be nil.

This commit makes these tests stub IO.console_size directly (the method
we actually call, we shouldn't have been relying on that calling
IO.console.winsize anyways) or passes the width when initializing the
class.

This allows tests to run without a TTY. This can be tested with ex.

    ssh localhost "cd src/rails/actionpack && bundle exec rake"

or

    (setsid bundle exec rake) </dev/null |& cat
2019-08-14 10:52:21 -07:00
Andrew Kress
36beec7b55 add test to check we read new path correctly 2019-08-14 12:36:59 -05:00
Andrew Kress
61c5a14cab rename to javascript_path, make attr_accessor 2019-08-14 12:36:27 -05:00
Andrew Kress
ffaee477bd create an attribute so that webpacker can set its default path instead of hardcoding 2019-08-13 15:20:59 -05:00
Xavier Noria
8ab4fd12f1 documents how to troubleshoot autoloading in zeitwerk mode 2019-08-13 18:16:03 +02:00
Xavier Noria
5a70f33909 defines Rails.autoloaders.log! 2019-08-13 18:14:50 +02:00
Xavier Noria
841ac6ceb2 6.x -> 6.0 [skip ci] 2019-08-12 23:47:42 +02:00
Rafael França
16b09a8eec
Merge pull request #36915 from bogdanvlviv/remove-active_storage-migration-related-to-rails-6-0-update
Remove `AddForeignKeyConstraintToActiveStorageAttachmentsForBlobId` migration
2019-08-12 17:17:10 -04:00
Rafael França
ac9416f355
Merge pull request #36920 from garethson/log-active-job-potential-matches
Log active_job potential matches when asserting
2019-08-12 16:33:07 -04:00
Gareth du Plooy
060a1fb338 Log active_job potential matches when asserting
Adds logging of potential matches when calling `assert_enqueued_with` and `assert_performed_with` to provide more information on test failures.
2019-08-12 15:16:12 -05:00
Xavier Noria
aec2f3828c 6.x -> 6.0 [skip ci]
This 6.x seems to be confusing to some people.
2019-08-12 20:08:19 +02:00
Rafael Mendonça França
e44a197997
Nodoc class that should not be part of public API 2019-08-12 13:21:58 -04:00
bogdanvlviv
f2819f7876
Remove AddForeignKeyConstraintToActiveStorageAttachmentsForBlobId migration
In https://github.com/rails/rails/pull/33419, we added this migration to
properly upgrade Active Storage from 5.2 to 6.0

On Rails 6.1 `rails app:update` shouldn't add this migration to users' app.

Note that, I've left implementation that makes `rails app:update` to generate
migrations for users' app that are in `activestorage/db/update_migrate/`
because we are likely to need it e.g.: https://github.com/rails/rails/pull/34935, https://github.com/rails/rails/pull/36835.
2019-08-12 15:37:51 +03:00
Carlos Antonio da Silva
9a2e00e27b
Merge pull request #36906 from wjessop/fix_collection_rendering_docs
Remove misleading documentation [ci skip]
2019-08-09 23:51:23 -03:00
Will Jessop
fdb6a90794
Remove misleading documentation
The docs for ActionView partial renderer state:

> NOTE: Due to backwards compatibility concerns, the collection can't be one of hashes. Normally you'd also just keep domain objects, like Active Records, in there.

The reporter stated:

> I can render a collection of hashes without problems:
>
> = render :partial => "info_row", :collection => my_collection, :as => :d

I tested this in a Rails 6.0 rc2 app and hashes were passed as described. Fixes #36897. [ci skip]
2019-08-10 02:52:15 +01:00
John Hawthorn
599c170d8e
Merge pull request #36873 from jhawthorn/schema_sha_parallel
Sync parallel test DBs to schema using SHA
2019-08-09 15:43:48 -07:00
Rafael França
cce74a8b9e
Merge pull request #36901 from peterzhu2118/azure-test-content-type
Add test for content type in direct upload to Azure
2019-08-09 18:05:23 -04:00
Peter Zhu
d0ed8305ae Add test for content type in direct upload to Azure 2019-08-09 14:54:09 -04:00
Gannon McGibbon
88209624af
Merge pull request #36884 from gmcgibbon/allow_yaml_file_fixtures
Remove yaml file fixtures from regular fixtures
2019-08-09 14:52:06 -04:00
Gannon McGibbon
9899697794 Stop trying to read yaml file fixtures when loading Active Record fixtures 2019-08-09 14:24:59 -04:00
Carlos Antonio da Silva
61bda21e51
Merge pull request #36900 from akshaymohite/gemfile-lock-changes
Rails HTML sanitizer update changes to Gemfile lock on bundle install.
2019-08-09 13:03:52 -03:00
Akshay Mohite
7c52173cea
Rails HTML sanitizer gemfile lock changes on bundle install. 2019-08-09 21:10:59 +05:30
Ryuta Kamizono
bdfd470531
Merge pull request #36889 from kamipo/deprecate_reorder_with_non_deterministic_first
Deprecate `.reorder(nil)` with `.first` / `.first!` taking non-deterministic result
2019-08-09 17:58:35 +09:00
John Hawthorn
d8b8171343 Sync parallel test DBs to schema using SHA
Previously, every time we ran tests in parallel we would load the schema
for all N DBs.

Now that we have the ability to sync DBs with the schema file exactly
using metadata and a SHA, we can instead only load the schemas when they
change.
2019-08-08 23:08:40 -07:00
Rafael França
9ddd936f7a
Merge pull request #36896 from sharang-d/doc-fix
Standardize doc style for 'update_counters()' [ci skip]
2019-08-08 18:51:39 -04:00
Rafael Mendonça França
6ebdab3239
Merge pull request #36880 from freeletics/multiple-merge
Support multiple arguments in `HashWithIndifferentAccess` for `merge` and update methods
2019-08-08 18:27:57 -04:00
Kasper Timm Hansen
12001611d6
Require and support rails-html-sanitzer 1.2.0
Rails now requires 1.2.0 because it relies on the safe_list_sanitizer
API exclusively.

Also raise `sanitizer_vendor` API from the dead for
rails-deprecated_sanitizer.

Fixes https://github.com/rails/rails-deprecated_sanitizer/pull/6
2019-08-09 00:07:45 +02:00
Sharang Dashputre
fb654c1586 Standardize doc style for 'update_counters()' [ci skip] 2019-08-09 02:09:48 +05:30
Rafael Mendonça França
fb5f8d4f86
Remove invalid autoload of ActionDispatch::Http::Upload
This constant doesn't exists.
2019-08-08 15:08:45 -04:00
Ryuta Kamizono
eec562dbcf Deprecate .reorder(nil) with .first / .first! taking non-deterministic result
To continue taking non-deterministic result, use `.take` / `.take!`
instead.
2019-08-08 19:14:24 +09:00
Ryuta Kamizono
49b617f68c Restore an ability that reorder with first taking non-deterministic result
Actually, `first` taking non-deterministic result is considered a bug to
me. But changing the behavior should not be happened in rc2.

I've restored the behavior for 6.0, and then will deprecate that in 6.1.

Fixes #36802.
2019-08-08 18:34:10 +09:00
yuuji.yaginuma
6170a2a502 Remove feature policy initializer in API only apps
Because `FeaturePolicy::Middleware` is not loaded in API only apps.
Ref: 646dd8c51f/railties/lib/rails/application/default_middleware_stack.rb (L69-L72)
2019-08-08 17:47:07 +09:00
John Hawthorn
646dd8c51f
Merge pull request #36883 from jhawthorn/schema_sha_fix
Fix test schema loading for multi-db
2019-08-07 14:52:03 -07:00
John Hawthorn
ec2dcddf79
Merge pull request #36848 from jhawthorn/type_error_on_resolve_connection
Raise TypeError instead of infinite loop in resolve_connection
2019-08-07 14:51:26 -07:00
Richard Schneeman
d44fdd2969
Merge pull request #36885 from piratebroadcast/patch-2
Updated to add Derailed link
2019-08-07 16:19:39 -05:00
Gannon McGibbon
0f5db107a2
Merge pull request #36727 from gmcgibbon/active_storage_sharded
Pass optional record in blob finder methods
2019-08-07 16:55:02 -04:00
Gannon McGibbon
dacfa5b792
Merge pull request #36847 from gmcgibbon/fix_custom_pk_through_reflect
Ensure custom PK types are casted in through reflection queries
2019-08-07 16:48:21 -04:00
Jesse Waites
0220b8d61f
Updated to add Derailed link 2019-08-07 16:46:06 -04:00
Gannon McGibbon
5ec2f35f27 Ensure custom PK types are casted in through reflection queries
Make sure primary keys with non-integer types can be correctly type
casted in through reflections.
2019-08-07 16:27:33 -04:00
Rafael França
d580d8c6dd
Merge pull request #36882 from abhaynikam/36856-multi-part-test-helper-minor-change
Correct the assertion argument order
2019-08-07 14:56:35 -04:00