Created
October 18, 2015 06:03
-
-
Save oojikoo-gist/07cebaa6c8ccfc4fce4c to your computer and use it in GitHub Desktop.
rails: seed per environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
['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