Created
April 26, 2016 03:04
-
-
Save mindaslab/9d09e06bcb67dc5f795bb272bd0f431d to your computer and use it in GitHub Desktop.
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
# lib/tasks/custom_seed.rake | |
namespace :db do | |
namespace :seed do | |
Dir[File.join(Rails.root, 'db', 'seeds', '*.rb')].each do |filename| | |
task_name = File.basename(filename, '.rb').intern | |
task task_name => :environment do | |
load(filename) if File.exist?(filename) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment