Guest User

Untitled

a guest
Apr 25th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. desc "Load development data"
  2. task :load_dev => :environment do
  3. require 'active_record/fixtures'
  4. ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
  5. basepath = File.join(RAILS_ROOT, 'fixtures','dev')
  6. Dir.glob(File.join(basepath, '*.yml')).each do |fixture_file|
  7. puts "Loading fixtures %s" % fixture_file
  8. Fixtures.create_fixtures(basepath, File.basename(fixture_file, '.*'))
  9. end
  10. puts "Done"
  11. end
Add Comment
Please, Sign In to add comment