If a relation has eager_load and string joins only, string joins will be
regarded as leading joins unlike before, due to #36805.
To maintain that joining order as before, check eager loading join
first before string joins.
Fixes#37133.
Uses of `current_config` and `current_config=` were removed when
implementing multiple datatabase Rails tasks. This means they are no
longer used internally. However, since it is a documented method it may
be used in gems or applications. This change deprecates these methods so
that we can remove them in 6.2.
Co-authored-by: John Crepezzi <john.crepezzi@gmail.com>
Similar to b744372f2dfd3d86f7eb4af99b1f9049e21f3d44, this defers loading
`ActionDispatch::Response` until after initialization, which will allow
applications to boot a bit faster in development but also paves the way
for `return_only_media_type_on_content_type` to work correctly when set
from `new_framework_defaults_6_0.rb`.
Benchmark:
$ cat test.rb
require "bundler/setup"
before = ObjectSpace.each_object(Module).count
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
require "action_controller"
finish = Process.clock_gettime(Process::CLOCK_MONOTONIC)
after = ObjectSpace.each_object(Module).count
puts "took #{finish - start} and created #{after - before} modules"
Before:
$ ruby test.rb
took 0.35654300000169314 and created 608 modules
After:
$ ruby test.rb
took 0.2770050000108313 and created 466 modules
Co-authored-by: Serena Fritsch <serena@intercom.io>
Initially I just wanted to remove _to_ from _We call autoload paths to
the list..._. But this sentence also seemed a little bit overcomplicated
😅
[ci skip]
This commit fixes a method typo that was introduced in #37199, also also
adds tests for the `DatabaseTasks#current_config` method given it's
current implementation.
While I was in here, I also made it so that if `current_config` is
called with an `env` it won't try to look up the `Rails.env`
potentially resulting in an error for non-Rails application.
IMO this method should be deprecated & removed as it's no longer used in
Rails, is confusing (for example: `test_current_config_read_after_set`),
and is currently dependent on Rails if `env` isn't passed.
Co-authored-by: eileencodes <eileencodes@gmail.com>
Currently `wrapped` is a String. Instead pass Class so that Sidekiq can get access to the ActiveJob and its configuration without having to constantize. I verified that `JobClass.to_s` == `"JobClass"` so serialization to JSON should not be affected.
```ruby
> JSON.dump({"wrapped" => SomeJob})
=> "{\"wrapped\":\"SomeJob\"}"
```
By having access to the ActiveJob class, Sidekiq can get access to any `sidekiq_options` which have been set on that ActiveJob type and serialize those options into Redis.
https://github.com/mperham/sidekiq/blob/master/Changes.md#60
Remove 'now just' — document the current state in an accessible way. Make it clear the set of helpers isn't **exactly** the same
Add references to `mailer` and `message` helpers which can be very useful.
`attachments` is already covered in "Making Inline Attachments"
Finding the mail-specific formatting heleprs are
Per #36949 we introduce a race condition fix for #36763
This refines the fix to avoid using Concurrent::ThreadLocalVar
The implementation in the concurrent lib is rather expensive, culminating in
a finalizer per object that spins off a thread to do cleanup work.
None of this expense is needed as we can simply implement
the desired behavior using Ruby primitives. Additionally this moves to a Fiber bound implementation vs a thread bound implementation, something that is not desired for this particular usage.
This reverts commit c6ef71ccf23fcfb73c3cce82d8437a9bcb5bd07c
because this causes "wrong number of arguments (given 2, expected 1) (ArgumentError)" on Ruby 2.5