From 41c8cc632af74534a3698b498b1767bb9fe22fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 13 Jun 2014 16:47:15 -0300 Subject: Revert code changes at "Copy edits and code font wrap for Active Record [ci skip]" This partially reverts commit 1a203d5e07f639332880099fab610b886b1742fc. Reason: It was committed by accident --- activerecord/lib/active_record/fixtures.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/fixtures.rb') diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 0d12dd5ddf..4cd5f92207 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -569,7 +569,13 @@ module ActiveRecord @path = path @config = config @model_class = nil - @model_class = class_name + + if class_name.is_a?(Class) # TODO: Should be an AR::Base type class, or any? + @model_class = class_name + else + @model_class = class_name.safe_constantize if class_name + end + @connection = connection @table_name = ( model_class.respond_to?(:table_name) ? -- cgit v1.2.3