diff options
author | Viktar Basharymau <viktar.basharymau@thehamon.com> | 2014-06-25 12:51:30 +0300 |
---|---|---|
committer | Viktar Basharymau <viktar.basharymau@thehamon.com> | 2014-06-27 17:46:47 +0300 |
commit | 41fb066394245c5fd0ffb13cc5f755abff7e1081 (patch) | |
tree | 9c64cb43440fe37db4fd6fb99dee14703c4e49c4 | |
parent | 0526fad51a06ee4b739c4ec0ecd9f26351f5c08f (diff) | |
download | rails-41fb066394245c5fd0ffb13cc5f755abff7e1081.tar.gz rails-41fb066394245c5fd0ffb13cc5f755abff7e1081.tar.bz2 rails-41fb066394245c5fd0ffb13cc5f755abff7e1081.zip |
Replace a bit of cryptic code in fixtures:load rake task with plain stupid Ruby
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 2a44c9e559..a293487032 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -191,7 +191,11 @@ db_namespace = namespace :db do base_dir = ActiveRecord::Tasks::DatabaseTasks.fixtures_path - fixtures_dir = File.join [base_dir, ENV['FIXTURES_DIR']].compact + fixtures_dir = if ENV['FIXTURES_DIR'] + File.join base_dir, ENV['FIXTURES_DIR'] + else + base_dir + end (ENV['FIXTURES'] ? ENV['FIXTURES'].split(',') : Dir["#{fixtures_dir}/**/*.yml"].map {|f| f[(fixtures_dir.size + 1)..-5] }).each do |fixture_file| ActiveRecord::FixtureSet.create_fixtures(fixtures_dir, fixture_file) |