From d35b10c1b874341f5e1adeaf201e5276d7dae5c5 Mon Sep 17 00:00:00 2001 From: Matchu Date: Fri, 10 Nov 2023 16:16:32 -0800 Subject: [PATCH] Oops, fix validation bug for SwfAsset Oh right, saving an asset that doesn't have a manifest will crash this validation step! --- app/models/swf_asset.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/swf_asset.rb b/app/models/swf_asset.rb index 5284f5e0..dc8a763c 100644 --- a/app/models/swf_asset.rb +++ b/app/models/swf_asset.rb @@ -16,7 +16,7 @@ class SwfAsset < ApplicationRecord scope :includes_depth, -> { includes(:zone) } - before_validation :normalize_manifest_url + before_validation :normalize_manifest_url, if: :manifest_url? def swf_image_dir @swf_image_dir ||= Rails.root.join('tmp', 'asset_images_before_upload', self.id.to_s)