Jean Boussier
de779f2bf7
Fix ActiveSupport::Notifications.publish_event
to preserve units
...
Ref: https://github.com/rails/rails/pull/43502
Fix: https://github.com/rails/rails/pull/50767
Fix: https://github.com/rails/rails/pull/50493
When republishing a an event into a `start, finish` tuple, we need
to convert the timestamps back into seconds.
2024-01-17 12:53:40 +01:00
Gannon McGibbon
90c0bde47c
Rename behaviour to behavior in test case names
2022-05-26 17:14:18 -04:00
Nikita Vasilevsky
2a00c89a7d
Enable Lint/DuplicateMethods rubocop rule
2021-11-15 13:51:28 -05:00
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
Adrianna Chang
387aa8c373
Subscriber.attach_to with inherit_all option
2020-09-22 08:48:46 -04: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
Ryuta Kamizono
c81af6ae72
Enable Layout/EmptyLinesAroundAccessModifier
cop
...
We sometimes say "✂️ newline after `private`" in a code review (e.g.
https://github.com/rails/rails/pull/18546#discussion_r23188776 ,
https://github.com/rails/rails/pull/34832#discussion_r244847195 ).
Now `Layout/EmptyLinesAroundAccessModifier` cop have new enforced style
`EnforcedStyle: only_before` (https://github.com/rubocop-hq/rubocop/pull/7059 ).
That cop and enforced style will reduce the our code review cost.
2019-06-13 12:00:45 +09:00
sushant
ca19b7f5d8
Added 'detach_from' to 'ActiveSupport::Subscriber' to detach a subscriber from a namespace.
2019-04-04 10:57:57 +05:30
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 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e
Enforce frozen string in Rubocop
2017-07-01 02:11:03 +03:00
Xavier Noria
80e66cc4d9
normalizes indentation and whitespace across the project
2016-08-06 20:16:27 +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
Carlos Antonio da Silva
4e09c509af
Fix assertion arguments order
2014-07-31 08:56:22 -03:00
Rafael Mendonça França
2fdddcee6f
Remove warning remeving the method before redefining
...
We need to test if the same method defined more than once only register
one subscriber for it. We can safelly remove because the method body is
the same and Subscriber use method_added hook for register the
subscriber.
2014-05-23 11:45:28 -03:00
Dennis Schoen
b50468d13d
Fixed duplicate subscribers in ActiveSupport::Subscriber
...
ActiveSupport::Subscriber no longer creates multiple subscribers when
you redefine a method.
2014-05-09 11:16:18 +02:00
Daniel Schierbeck
d2824a347f
Allow attaching to AS::Notifications namespace up front
...
Before, you were required to attach *after* adding the methods to the
class, since the attachment process needed the methods to be present.
With this change, any new method will also be attached to the configured
namespace.
2013-09-20 10:14:28 +02:00