Skip to content

Instantly share code, notes, and snippets.

@paulbaker3
Created December 5, 2013 18:39
Show Gist options
  • Save paulbaker3/7810855 to your computer and use it in GitHub Desktop.
Save paulbaker3/7810855 to your computer and use it in GitHub Desktop.
Creates a set of custom rake tasks. Place this in a file in {app_root}/lib/tasks/<file_name>.rake Invoke the custom_demo_data task from the command line as => rake populate:custom_demo_data COMPANY="Foo Bar Inc"
namespace :populate do
desc "Populates the production database with demo data to support sales"
task :generic_demo_data do
puts "populating the database with demo data"
end
desc "Populates the production database with test data for manual testing"
task :test_data do
puts "populating the database with test data"
end
desc "Populates the production database with demo data for a specific sales lead"
task :custom_demo_data => :environment do
puts "populating the database with demo data for #{ENV['COMPANY']}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment