Permalink
Browse files

Replace a bit of cryptic code in fixtures:load rake task with plain s…

…tupid Ruby
  • Loading branch information...
1 parent 0526fad commit 41fb066394245c5fd0ffb13cc5f755abff7e1081 @DNNX DNNX committed Jun 25, 2014
Showing with 5 additions and 1 deletion.
  1. +5 −1 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)

0 comments on commit 41fb066

Please sign in to comment.