Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Be careful not to reference ActiveRecord if it isn't loaded, fixing r…

…ake test when you're working without a database. [eedn]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8339 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 77de690a56b52909d45c300fd37b452c19fbb81e 1 parent 2c951ef
@jeremy jeremy authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 activerecord/lib/active_record/fixtures.rb
View
7 activerecord/lib/active_record/fixtures.rb
@@ -9,7 +9,12 @@ def values; map { |k, v| v } end
end
end
-class FixtureClassNotFound < ActiveRecord::ActiveRecordError #:nodoc:
+if defined? ActiveRecord
+ class FixtureClassNotFound < ActiveRecord::ActiveRecordError #:nodoc:
+ end
+else
+ class FixtureClassNotFound < StandardError #:nodoc:
+ end
end
# Fixtures are a way of organizing data that you want to test against; in short, sample data. They come in 3 flavors:
Please sign in to comment.
Something went wrong with that request. Please try again.