Move method 'recover_image_from_cache' from imageable controllers to image.
This commit is contained in:
@@ -10,8 +10,6 @@ class ImagesController < ApplicationController
|
||||
end
|
||||
|
||||
def create
|
||||
recover_attachments_from_cache
|
||||
|
||||
if @image.save
|
||||
flash[:notice] = t "images.actions.create.notice"
|
||||
redirect_to params[:from]
|
||||
@@ -62,10 +60,4 @@ class ImagesController < ApplicationController
|
||||
@image.user = current_user
|
||||
end
|
||||
|
||||
def recover_attachments_from_cache
|
||||
if @image.attachment.blank? && @image.cached_attachment.present?
|
||||
@image.set_attachment_from_cached_attachment
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user