impress/lib/tasks/pet_states.rake

14 lines
471 B
Ruby
Raw Normal View History

2013-11-30 17:33:48 -08:00
namespace :pet_states do
desc "Sort pet state SWFs, then remove duplicates and reassign children"
task :repair => :environment do
PetState.repair_all!
end
desc "Delete the bad pet state, replacing it in outfits with the good pet state"
task :replace, [:bad_id, :good_id] => :environment do |t, args|
bad, good = PetState.find(args[:bad_id], args[:good_id])
outfit_count = bad.replace_with(good)
puts "Updated #{outfit_count} outfits"
end
end