Remove unnedded code

This commit is contained in:
Senén Rodero Rodríguez
2017-09-23 23:22:41 +02:00
parent 0a86727c6a
commit 93e5c9656c

View File

@@ -57,10 +57,7 @@ module CommentableActions
end
def update
resource.assign_attributes(strong_params)
recover_image_from_cache(resource)
if resource.save
if resource.update(strong_params)
redirect_to resource, notice: t("flash.actions.update.#{resource_name.underscore}")
else
load_categories
@@ -112,10 +109,4 @@ module CommentableActions
nil
end
def recover_image_from_cache(resource)
return false unless resource.try(:image)
resource.image.attachment = resource.image.set_attachment_from_cached_attachment if resource.image.cached_attachment.present?
end
end