Skip to content

Instantly share code, notes, and snippets.

@queso
Created March 27, 2010 04:37
Show Gist options
  • Save queso/345725 to your computer and use it in GitHub Desktop.
Save queso/345725 to your computer and use it in GitHub Desktop.
require 'active_record/fixtures'
puts "Loading regular seeds"
Dir[Rails.root.join("db/seed", "*.{yml,csv}")].each do |file|
Fixtures.create_fixtures("db/seed", File.basename(file, '.*'))
end
puts "Loading #{Rails.env} seeds"
Dir[Rails.root.join("db/seed", Rails.env, "*.{yml,csv}")].each do |file|
Fixtures.create_fixtures("db/seed/#{Rails.env}", File.basename(file, '.*'))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment