Skip to content

Instantly share code, notes, and snippets.

@oojikoo-gist
Created October 18, 2015 06:03
Show Gist options
  • Save oojikoo-gist/07cebaa6c8ccfc4fce4c to your computer and use it in GitHub Desktop.
Save oojikoo-gist/07cebaa6c8ccfc4fce4c to your computer and use it in GitHub Desktop.
rails: seed per environment
['all', Rails.env].each do |seed|
seed_file = "#{Rails.root}/db/seeds/#{seed}.rb"
if File.exists?(seed_file)
puts "*** Loading #{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