diff options
author | Viktar Basharymau <viktar.basharymau@thehamon.com> | 2014-06-25 12:53:03 +0300 |
---|---|---|
committer | Viktar Basharymau <viktar.basharymau@thehamon.com> | 2014-06-27 17:46:47 +0300 |
commit | 5a4df8005145a7c6529c4e9ed92e3f4927aa55e7 (patch) | |
tree | ebe684fa3ae051e91f9b7c01c4371b9ce7bc6bdb | |
parent | 41fb066394245c5fd0ffb13cc5f755abff7e1081 (diff) | |
download | rails-5a4df8005145a7c6529c4e9ed92e3f4927aa55e7.tar.gz rails-5a4df8005145a7c6529c4e9ed92e3f4927aa55e7.tar.bz2 rails-5a4df8005145a7c6529c4e9ed92e3f4927aa55e7.zip |
Extract `fixture_files` variable in fixtures:load rake task
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index a293487032..816fca4f85 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/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 |