Commit 757cddf5

mo k <mo@mokhan.ca>
2012-11-08 14:52:47
move the migration job to the commands folder.
1 parent da89676
app/services/commands/migrate_primary_image.rb
@@ -0,0 +1,10 @@
+class MigratePrimaryImage < Struct.new(:creation_id)
+  def perform
+    creation = Creation.find(creation_id)
+    photo = creation.photos.build({})
+    photo.created_at = creation.created_at
+    photo.updated_at = creation.updated_at
+    photo.image = creation.image.file
+    photo.save!
+  end
+end
db/migrate/20121010190225_migrate_images_for_each_creation.rb
@@ -1,14 +1,3 @@
-class MigratePrimaryImage < Struct.new(:creation_id)
-  def perform
-    creation = Creation.find(creation_id)
-    photo = creation.photos.build({})
-    photo.created_at = creation.created_at
-    photo.updated_at = creation.updated_at
-    photo.image = creation.image.file
-    photo.save!
-  end
-end
-
 class MigrateImagesForEachCreation < ActiveRecord::Migration
   def up
     Creation.all.each_with_index do |creation, index|