1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

13 commits

Author SHA1 Message Date
Jean Boussier
091dc78f94 Forward sql.active_record notifications back into the calling thread
It is not uncommon for `sql.active_record` subscribers to rely on
thread local or fiber local state. For instance the `buffered-logger`
gem buffer the logs in a thread variable.

With the introduction of async queries, the `sql.active_record`
events can now be produced from a background thread and that break
some expectations.

This makes it hard for subscriber to map the event to the request
or job that scheduled it.

That is why I believe we should instead store the event and
publish it back on the calling thread when the results are
accessed.
2021-03-03 10:33:37 +01:00
Michael Grosser
203998c916
allow running each test with pure ruby path/to/test.rb
also:
 - makes test dependencies obvious
 - makes tests runnable from within subfolders
2019-12-18 08:49:19 -06:00
Ali Ibrahim
1b7ef40db5 Update AS::Notifications::Instrumenter#instrument
* Update #instrument to make passing a block optional. This will let users
    leverage #instrument for messaging in addition to instrumentation.
2019-03-22 10:01:18 -04:00
Daniel Colson
82c39e1a0b Use assert_empty and assert_not_empty 2018-01-25 23:32:59 -05:00
Koichi ITO
ac717d65a3 [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
Kir Shatrov
72950568dd Use frozen-string-literal in ActiveSupport 2017-07-09 15:08:29 +03:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590, reversing
changes made to afb66a5a59.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
Rafael Mendonça França
fe1f4b2ad5
Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
Xavier Noria
5c315a8fa6 modernizes hash syntax in activesupport 2016-08-06 19:38:33 +02:00
Xavier Noria
a731125f12 applies new string literal convention in activesupport/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:10:53 +02:00
stopdropandrew
a007800a55 ActiveSupport::Notifications::Instrumenter#instrument should yield
its payload the same way that ActiveSupport::Notifications does.
Fix spelling in test name.
2013-03-02 16:05:05 -08:00
Aaron Patterson
56f3d05f47 adding start / finish on the instrumenter, adding tests for the class 2013-01-09 15:34:58 -08:00