Commit 09e9d417
Changed files (6)
app/services/application/migrate_primary_image.rb
@@ -1,10 +0,0 @@
-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
app/services/application/recreate_photo_versions.rb
@@ -1,6 +0,0 @@
-class RecreatePhotoVersions < Struct.new(:photo_id)
- def perform
- photo = Photo.find(photo_id)
- photo.image.recreate_versions!
- end
-end
app/services/application/upload_image_worker.rb
@@ -1,5 +0,0 @@
-class UploadImageWorker < ::CarrierWave::Workers::StoreAsset
- def error(job, exception)
- ExceptionNotifier.notify_exception(exception)
- end
-end
db/migrate/20121010190225_migrate_images_for_each_creation.rb
@@ -1,13 +0,0 @@
-class MigrateImagesForEachCreation < ActiveRecord::Migration
- def up
- Creation.all.each_with_index do |creation, index|
- Delayed::Job.enqueue MigratePrimaryImage.new(creation.id)
- end
- end
-
- def down
- Photo.where(:is_primary => true).each do |photo|
- photo.destroy
- end
- end
-end
db/migrate/20121211142144_re_migrate_creations.rb
@@ -1,10 +0,0 @@
-class ReMigrateCreations < ActiveRecord::Migration
- def up
- Creation.all.each_with_index do |creation, index|
- Delayed::Job.enqueue MigratePrimaryImage.new(creation.id)
- end
- end
-
- def down
- end
-end
db/migrate/20121215051249_recreate_versions.rb
@@ -1,11 +0,0 @@
-class RecreateVersions < ActiveRecord::Migration
- def up
- Photo.all.each do |photo|
- puts "recreating #{photo.id}"
- Delayed::Job.enqueue RecreatePhotoVersions.new(photo.id)
- end
- end
-
- def down
- end
-end