From 93e5c9656c161fafb2cfc1a81e22e2280388d6f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Sat, 23 Sep 2017 23:22:41 +0200 Subject: [PATCH] Remove unnedded code --- app/controllers/concerns/commentable_actions.rb | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/controllers/concerns/commentable_actions.rb b/app/controllers/concerns/commentable_actions.rb index 44c98e760..4a1098a28 100644 --- a/app/controllers/concerns/commentable_actions.rb +++ b/app/controllers/concerns/commentable_actions.rb @@ -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