aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/current_attributes_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Support before_reset callback in CurrentAttributesRosa Gutierrez2019-01-301-7/+30
| | | | | | | | | This is useful when we need to do some work associated to `Current.reset` but that work depends on the values of the current attributes themselves. This cannot be done in the supported `resets` callback because when the block is executed, CurrentAttributes's instance has already been reset. For symmetry, `after_reset` is defined as alias of `resets`.
* Merge remote-tracking branch 'origin/master' into unlock-minitestRafael Mendonça França2017-08-011-0/+1
|\
| * [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
| |
* | Merge branch 'master' into unlock-minitestKasper Timm Hansen2017-07-151-0/+1
|\|
| * Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
| |
| * Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
| * Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
| |
* | Reset time zone to previous valueyuuji.yaginuma2017-05-301-1/+8
|/ | | | | | | | | | | Since `CurrentAttributesTest` changed the global time zone, it is necessary to restore the original value after changing the test. The reproduction step: ``` ./bin/test -w --seed 5549 test/current_attributes_test.rb test/core_ext/date_ext_test.rb ```
* ActiveSupport::CurrentAttributes provides a thread-isolated attributes ↵David Heinemeier Hansson2017-05-261-0/+96
singleton (#29180) * Add ActiveSupport::CurrentAttributes to provide a thread-isolated attributes singleton * Need to require first * Move stubs into test namespace. Thus they won't conflict with other Current and Person stubs. * End of the line for you, whitespace! * Support super in attribute methods. Define instance level accessors in an included module such that `super` in an overriden accessor works, akin to Active Model. * Spare users the manual require. Follow the example of concerns, autoload in the top level Active Support file. * Add bidelegation support * Rename #expose to #set. Simpler, clearer * Automatically reset every instance. Skips the need for users to actively embed something that resets their CurrentAttributes instances. * Fix test name; add tangible name value when blank. * Try to ensure we run after a request as well. * Delegate all missing methods to the instance This allows regular `delegate` to serve, so we don't need bidelegate. * Properly test resetting after execution cycle. Also remove the stale puts debugging. * Update documentation to match new autoreset