aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-09-05 14:47:42 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-09-05 14:47:42 -0700
commit30e987936bb2f6122e64d6664e72907881b4ba11 (patch)
tree9198ef4adbc395fb45bd7cc2ecc0967f0695c386
parentc9789d252d575853ed99e2d051cd84486c27ee5d (diff)
downloadrails-30e987936bb2f6122e64d6664e72907881b4ba11.tar.gz
rails-30e987936bb2f6122e64d6664e72907881b4ba11.tar.bz2
rails-30e987936bb2f6122e64d6664e72907881b4ba11.zip
push logic outside the FixtureSet constructor
-rw-r--r--activerecord/lib/active_record/fixtures.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index e71cbee8d7..c4decfbf73 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -479,8 +479,9 @@ module ActiveRecord
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 @@ module ActiveRecord
@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 :