From f766abd4cf3eb75469d3646cfb6d85e668c619f3 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Fri, 21 Nov 2014 14:57:25 +0100 Subject: make it possible to access fixtures excluded by a `default_scope`. Prior to this patch you'd end up with an error like: ``` ActiveRecord::RecordNotFound: Couldn't find with 'id'= [WHERE ()] ``` --- activerecord/lib/active_record/fixtures.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index db6421dacb..660ba18a98 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -806,7 +806,7 @@ module ActiveRecord def find if model_class - model_class.find(fixture[model_class.primary_key]) + model_class.unscoped.find(fixture[model_class.primary_key]) else raise FixtureClassNotFound, "No class attached to find." end -- cgit v1.2.3