Permalink
Browse files

Tweak fixtures so they don't try to use a non-ActiveRecord class. [Ke…

…vin Clark]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4752 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 69266a0 commit 02021d89b1928e9869b0038afc08cb6b3e719014 @technoweenie technoweenie committed Aug 11, 2006
Showing with 13 additions and 1 deletion.
  1. +2 −0 activerecord/CHANGELOG
  2. +1 −1 activerecord/lib/active_record/fixtures.rb
  3. +10 −0 activerecord/test/fixtures_test.rb
View
@@ -1,5 +1,7 @@
*SVN*
+* Tweak fixtures so they don't try to use a non-ActiveRecord class. [Kevin Clark]
+
* Remove ActiveRecord::Base.reset since Dispatcher doesn't use it anymore. [Rick Olson]
* Document find's :from option. Closes #5762. [andrew@redlinesoftware.com]
@@ -395,7 +395,7 @@ def value_list
klass = @class_name.constantize rescue nil
list = @fixture.inject([]) do |fixtures, (key, value)|
- col = klass.columns_hash[key] unless klass.nil?
+ col = klass.columns_hash[key] if klass.kind_of?(ActiveRecord::Base)
fixtures << ActiveRecord::Base.connection.quote(value, col).gsub('\\n', "\n").gsub('\\r', "\r")
end
list * ', '
@@ -343,3 +343,13 @@ def test_raises_error
end
end
end
+
+class DevelopersProject; end;
+
+class ManyToManyFixturesWithClassDefined < Test::Unit::TestCase
+ fixtures :developers_projects
+
+ def test_this_should_run_cleanly
+ assert true
+ end
+end

0 comments on commit 02021d8

Please sign in to comment.