Commit 8a0be0cb

mo k <mo@mokhan.ca>
2012-10-16 03:29:30
remove publishing logic after version creation.
1 parent 7b3b62b
Changed files (4)
app/models/creation.rb
@@ -31,8 +31,6 @@ class Creation < ActiveRecord::Base
   end
 
   def publish
-    if (photos.where(:is_primary => true).any?)
-      self.update_attribute(:is_published, true)
-    end
+    self.update_attribute(:is_published, true)
   end
 end
app/models/photo.rb
@@ -9,10 +9,6 @@ class Photo < ActiveRecord::Base
     creation.watermark
   end
 
-  def processing_complete
-    creation.publish if is_primary
-  end
-
   def to_s
     "#{id} #{image}"
   end
app/uploaders/photo_uploader.rb
@@ -4,7 +4,6 @@ class PhotoUploader < CarrierWave::Uploader::Base
   include CarrierWave::RMagick
   include CarrierWave::MimeTypes
   include ::CarrierWave::Backgrounder::Delay
-  after :store, :publish_photo
 
   if Rails.env.production?
     storage :fog
@@ -62,8 +61,4 @@ class PhotoUploader < CarrierWave::Uploader::Base
       super.chomp(File.extname(super)) + '.png'
     end
   end
-
-  def publish_photo(file)
-    model.processing_complete
-  end
 end
spec/models/creation_spec.rb
@@ -13,7 +13,7 @@ describe Creation do
       Creation.find(sut.id).is_published.should == true
     end
     before(:each) do
-      sut.migrate_primary_image
+      sut.publish
     end
   end