diff options
author | Eugene Kenny <elkenny@gmail.com> | 2017-12-12 06:31:45 +0000 |
---|---|---|
committer | Eugene Kenny <elkenny@gmail.com> | 2017-12-12 06:31:45 +0000 |
commit | 6122d2bfdf09fb4a3e70d619556ef471be274169 (patch) | |
tree | 39020caebc9533f709b646b778ba712d122be008 /activerecord/lib/active_record | |
parent | c5462d1f27f7d43624e188008b0062d1d25369aa (diff) | |
download | rails-6122d2bfdf09fb4a3e70d619556ef471be274169.tar.gz rails-6122d2bfdf09fb4a3e70d619556ef471be274169.tar.bz2 rails-6122d2bfdf09fb4a3e70d619556ef471be274169.zip |
Prevent race condition when resetting time stubs
If the current thread is preempted after the stub has been removed but
before the original method has been restored, then the other thread will
get a `NoMethodError` when it tries to call the method.
Using `silence_redefinition_of_method` instead of `undef_method` ensures
that either the stub or the original method is always in place.
Diffstat (limited to 'activerecord/lib/active_record')
0 files changed, 0 insertions, 0 deletions