I have a set of fixtures in my db/bootstrap dir. anybody have any idea
on how I can use rake db:fixtures:load with fixtures in a different
dir?
I ended up modifying the rails db:fixtures:load task:
namespace :db do
namespace :bootstrap do
namespace :fixtures do
desc “Load fixtures into the current environment’s
database. Load specific fixtures using FIXTURES=x,y”
task :load => :environment do
require ‘active_record/fixtures’
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
(ENV[‘FIXTURES’] ? ENV[‘FIXTURES’].split(/,/) :
Dir.glob(File.join(RAILS_ROOT, ‘db’, ‘bootstrap’, ‘.
{yml,csv}’))).each do |fixture_file|
Fixtures.create_fixtures(‘db/bootstrap’,
File.basename(fixture_file, '.’))
end
end
end
end
end
Looking at the code it makes me wonder if the rails version of
Fixtures.create_fixtures is windows compatible because of the unix
path it uses for ‘test/fixtures’
Hmm…