Skip to content

Commit

Permalink
Fixed deprecation warnings: added Rails.root and Rails.env
Browse files Browse the repository at this point in the history
  • Loading branch information
steveyken committed Nov 25, 2011
1 parent 5a7d2f2 commit 517b458
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tasks/rspec_compatibility.rake
Expand Up @@ -6,8 +6,8 @@ namespace :spec do
desc "Load fixtures (from spec/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, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
ActiveRecord::Base.establish_connection(Rails.env.to_sym)
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(Rails.root, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
end
end
Expand Down

0 comments on commit 517b458

Please sign in to comment.