From 0ac5da33b072ea6b092262522b978eebc79f9374 Mon Sep 17 00:00:00 2001 From: cyrillefr Date: Mon, 26 May 2025 08:17:00 +0200 Subject: [PATCH] Fixes Rubocop SecurityOpen offense --- .rubocop_todo.yml | 5 ----- app/services/image_importer.rb | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 74b0f4f07d..f778f90e75 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -238,11 +238,6 @@ Rails/UniqueValidationWithoutIndex: - 'app/models/spree/tax_category.rb' - 'app/models/spree/zone.rb' -# Offense count: 1 -Security/Open: - Exclude: - - 'app/services/image_importer.rb' - # Offense count: 23 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. diff --git a/app/services/image_importer.rb b/app/services/image_importer.rb index 377881fa00..40fd7680d4 100644 --- a/app/services/image_importer.rb +++ b/app/services/image_importer.rb @@ -3,7 +3,7 @@ class ImageImporter def import(url, product) valid_url = URI.parse(url) - file = open(valid_url.to_s) + file = File.open(valid_url.to_s) filename = File.basename(valid_url.path) Spree::Image.create(