From 68f5a6bebd35ad2cf8bfc599b88841bf9df37208 Mon Sep 17 00:00:00 2001 From: Luka Murn Date: Wed, 30 May 2018 14:41:20 +0200 Subject: [PATCH] Fix inventory rows without files not being saved bug Closes SCI-2471. --- app/models/asset.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/asset.rb b/app/models/asset.rb index 055db8873..bf2d3f6f3 100644 --- a/app/models/asset.rb +++ b/app/models/asset.rb @@ -253,8 +253,8 @@ class Asset < ApplicationRecord report_elements.destroy_all asset_text_datum.destroy if asset_text_datum.present? # Nullify needed to force paperclip file deletion - self.file = nil - save + file = nil + save && reload end def destroy