Skip to content

Instantly share code, notes, and snippets.

@saboyutaka
Created December 11, 2013 05:58
Show Gist options
  • Save saboyutaka/7905711 to your computer and use it in GitHub Desktop.
Save saboyutaka/7905711 to your computer and use it in GitHub Desktop.
seeds file
%w(Seeds).each do |seed|
seed_file = "#{Rails.root}/db/seeds/fixtures/#{seed.pluralize.tableize}.rb"
if File.exists?(seed_file)
puts "Creating #{seed} seed data"
require seed_file
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment