Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

push logic outside the FixtureSet constructor

  • Loading branch information...
commit 30e987936bb2f6122e64d6664e72907881b4ba11 1 parent c9789d2
@tenderlove tenderlove authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/fixtures.rb
View
6 activerecord/lib/active_record/fixtures.rb
@@ -479,8 +479,9 @@ 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
fixtures_map[fs_name] = new( # ActiveRecord::FixtureSet.new
- connection,
+ conn,
fs_name,
klass,
::File.join(fixtures_directory, fs_name))
@@ -542,8 +543,7 @@ def initialize(connection, name, class_name, path, config = ActiveRecord::Base)
@model_class = class_name.safe_constantize if class_name
end
- @connection = ( model_class.respond_to?(:connection) ?
- model_class.connection : connection )
+ @connection = connection
@table_name = ( model_class.respond_to?(:table_name) ?
model_class.table_name :
Please sign in to comment.
Something went wrong with that request. Please try again.