Move method 'recover_documents_from_cache' from documentable controllers to document.

This commit is contained in:
Senén Rodero Rodríguez
2017-09-23 22:16:18 +02:00
parent ce29185b76
commit c22637c349
6 changed files with 3 additions and 23 deletions

View File

@@ -10,8 +10,6 @@ class DocumentsController < ApplicationController
end
def create
recover_attachments_from_cache
if @document.save
flash[:notice] = t "documents.actions.create.notice"
redirect_to params[:from]
@@ -62,10 +60,4 @@ class DocumentsController < ApplicationController
@document.user = current_user
end
def recover_attachments_from_cache
if @document.attachment.blank? && @document.cached_attachment.present?
@document.set_attachment_from_cached_attachment
end
end
end