Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix fixtures regression that required table names to map to classes o…

…nly, not class names
  • Loading branch information...
commit bac28d3bbdbe59109ac532935f06c2603ffe0fcd 1 parent c989a18
Jeremy Kemper jeremy authored
2  activerecord/lib/active_record/fixtures.rb
View
@@ -479,7 +479,7 @@ def self.create_fixtures(fixtures_directory, fixture_set_names, class_names = {}
fixture_sets = files_to_read.map do |fs_name|
klass = class_names[fs_name]
- conn = klass ? klass.connection : connection
+ conn = klass.respond_to?(:connection) ? klass.connection : connection
fixtures_map[fs_name] = new( # ActiveRecord::FixtureSet.new
conn,
fs_name,
2  activerecord/test/cases/fixtures_test.rb
View
@@ -78,7 +78,7 @@ def test_multiple_clean_fixtures
end
def test_create_symbol_fixtures
- fixtures = ActiveRecord::FixtureSet.create_fixtures(FIXTURES_ROOT, :collections, :collections => Course) { Course.connection }
+ fixtures = ActiveRecord::FixtureSet.create_fixtures(FIXTURES_ROOT, :collections, :collections => 'Course') { Course.connection }
assert Course.find_by_name('Collection'), 'course is not in the database'
assert fixtures.detect { |f| f.name == 'collections' }, "no fixtures named 'collections' in #{fixtures.map(&:name).inspect}"
Please sign in to comment.
Something went wrong with that request. Please try again.