diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2010-04-14 18:15:27 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-04-25 16:04:38 +0200 |
commit | 8ec085bf1804770a547894967fcdee24087fda87 (patch) | |
tree | 41cb3f488ec760649ad4b3be694652aa5a26641f /activerecord/lib/active_record/railties | |
parent | 77c099c231f2efb36a2a77a32138ed5c6761ec19 (diff) | |
download | rails-8ec085bf1804770a547894967fcdee24087fda87.tar.gz rails-8ec085bf1804770a547894967fcdee24087fda87.tar.bz2 rails-8ec085bf1804770a547894967fcdee24087fda87.zip |
Support fixtures for namespaced models [#2965 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record/railties')
-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 2b53afc68b..cb7eade0ab 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -258,8 +258,8 @@ namespace :db do 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 - (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/).map {|f| File.join(fixtures_dir, f) } : Dir.glob(File.join(fixtures_dir, '*.{yml,csv}'))).each do |fixture_file| - Fixtures.create_fixtures(File.dirname(fixture_file), File.basename(fixture_file, '.*')) + (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/).map {|f| File.join(fixtures_dir, f) } : Dir["#{fixtures_dir}/**/*.{yml,csv}"]).each do |fixture_file| + Fixtures.create_fixtures(fixtures_dir, fixture_file[(fixtures_dir.size + 1)..-5]) end end |