Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 073c2964c8
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (18 sloc) 0.762 kb
namespace :db do
desc "Initialize Defaults"
task :initialize_defaults => :environment do
puts "Clearing User and UserFavorite tables"
User.destroy_all
puts "Creating Someguy"
User.create(:name => "Someguy", :favorites => "boats,fishing,boat-fishing", :email => 'skynet@mailinator.com')
puts "Creating AnotherGuy"
User.create(:name => "AnotherGuy", :favorites => "eating,sleeping,sleep-walking", :email => 'skynet@mailinator.com')
puts "Creating YoMamma"
User.create(:name => "YoMomma", :favorites => "kidding,joking,pining", :email => 'skynet@mailinator.com')
puts "finished"
end
desc "Migrate Favorites"
task :migrate_favorites => :environment do
User.distributed_find(:all).map(:migrate_favorites)
end
end
Jump to Line
Something went wrong with that request. Please try again.