diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-29 17:28:34 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-29 18:21:24 -0700 |
commit | 1f5249bf937ec07ca644e500630e8c196394f252 (patch) | |
tree | b1400c3c3c47ae6e384ddccd115e7f13a268d3ef | |
parent | 9ef4b70b208c4c55b4fb981e4ec1ff7396a22a1a (diff) | |
download | rails-1f5249bf937ec07ca644e500630e8c196394f252.tar.gz rails-1f5249bf937ec07ca644e500630e8c196394f252.tar.bz2 rails-1f5249bf937ec07ca644e500630e8c196394f252.zip |
shorten up our fixture path resolving code
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 7d76d7a19f..fae88943ab 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -301,8 +301,8 @@ db_namespace = namespace :db do require 'active_record/fixtures' ActiveRecord::Base.establish_connection(Rails.env) - base_dir = ENV['FIXTURES_PATH'] ? File.join(Rails.root, ENV['FIXTURES_PATH']) : File.join(Rails.root, 'test', 'fixtures') - fixtures_dir = ENV['FIXTURES_DIR'] ? File.join(base_dir, ENV['FIXTURES_DIR']) : base_dir + base_dir = File.join [Rails.root, ENV['FIXTURES_PATH'] || %w{test fixtures}] + fixtures_dir = File.join [base_dir, ENV['FIXTURES_DIR']].compact (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir["#{fixtures_dir}/**/*.{yml,csv}"].map {|f| f[(fixtures_dir.size + 1)..-5] }).each do |fixture_file| Fixtures.create_fixtures(fixtures_dir, fixture_file) |