From 1ad3dee0dc421d45539f3c723d211a9b2eaabefd Mon Sep 17 00:00:00 2001 From: maxwell Date: Thu, 9 Dec 2010 19:27:04 -0800 Subject: [PATCH] another warning message in migration --- lib/tasks/migrations.rake | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/tasks/migrations.rake b/lib/tasks/migrations.rake index eb839746c..87385a80b 100644 --- a/lib/tasks/migrations.rake +++ b/lib/tasks/migrations.rake @@ -1,18 +1,26 @@ namespace :migrations do desc 'make old registered services into the new class specific services' + task :service_reclassify do + require File.join(Rails.root,"config/environment") + #include ActiveSupport::Inflector Service.all.each do |s| + puts s.inspect + provider = s.provider - s._type = "Services::#{provider.camelize}" - s.save + if provider + s._type = "Services::#{provider.camelize}" + s.save + else + puts "no provider found for service #{s.id}" + end end + puts "all done" end desc 'allow to upgrade old image urls to use rel path' task :swtich_image_urls do - - end desc 'move all posts and photos to new schema'