diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-11-22 15:36:50 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-11-22 15:36:50 -0700 |
commit | 6cd9e2bd29b26e1ea781fafce18614217b7adf7b (patch) | |
tree | 1d911ba061b45a627cb41a915c73af81b5b57286 /activerecord | |
parent | dcc143cd702bfbfef9cb92e1fde75171d088a5ac (diff) | |
download | rails-6cd9e2bd29b26e1ea781fafce18614217b7adf7b.tar.gz rails-6cd9e2bd29b26e1ea781fafce18614217b7adf7b.tar.bz2 rails-6cd9e2bd29b26e1ea781fafce18614217b7adf7b.zip |
Fix build failures
For some reason changing `.find` to `.unscoped.find` in
https://github.com/rails/rails/commit/f766abd4cf3eb75469d3646cfb6d85e668c619f3
caused `scoping` to leak in some tests when run in isolation (looks like
a concurrency issue?). `relation_scoping_test.rb` is a case that failed.
From what I can tell it should not be possible, but changing to the
block form fixes it. There is a deeper issue that I can't seem to find.
/cc @senny
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/fixtures.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 660ba18a98..7c53ee0a9a 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -806,7 +806,9 @@ module ActiveRecord def find if model_class - model_class.unscoped.find(fixture[model_class.primary_key]) + model_class.unscoped do + model_class.find(fixture[model_class.primary_key]) + end else raise FixtureClassNotFound, "No class attached to find." end |