Move method 'recover_image_from_cache' from imageable controllers to image.

This commit is contained in:
Senén Rodero Rodríguez
2017-09-23 23:09:31 +02:00
parent c22637c349
commit 0a86727c6a
8 changed files with 8 additions and 14 deletions

View File

@@ -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