Permalink
Browse files

Extract `fixture_files` variable in fixtures:load rake task

  • Loading branch information...
1 parent 41fb066 commit 5a4df8005145a7c6529c4e9ed92e3f4927aa55e7 @DNNX DNNX committed Jun 25, 2014
Showing with 7 additions and 1 deletion.
  1. +7 −1 activerecord/lib/active_record/railties/databases.rake
@@ -197,7 +197,13 @@ db_namespace = namespace :db do
base_dir
end
- (ENV['FIXTURES'] ? ENV['FIXTURES'].split(',') : Dir["#{fixtures_dir}/**/*.yml"].map {|f| f[(fixtures_dir.size + 1)..-5] }).each do |fixture_file|
+ fixture_files = if ENV['FIXTURES']
+ ENV['FIXTURES'].split(',')
+ else
+ Dir["#{fixtures_dir}/**/*.yml"].map {|f| f[(fixtures_dir.size + 1)..-5] }
+ end
+
+ fixture_files.each do |fixture_file|
ActiveRecord::FixtureSet.create_fixtures(fixtures_dir, fixture_file)
end
end

0 comments on commit 5a4df80

Please sign in to comment.