From eb2ebee16e308a29bab8f0131d16d3df8030145b Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 20 Aug 2019 16:40:50 +0200 Subject: [PATCH 1/3] fix flaky spec in ip_service_spec --- spec/services/ip_service_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/services/ip_service_spec.rb b/spec/services/ip_service_spec.rb index 2d2798fa0..48d1c59e7 100644 --- a/spec/services/ip_service_spec.rb +++ b/spec/services/ip_service_spec.rb @@ -2,6 +2,8 @@ require 'spec_helper' describe IPService do describe '.ip_trusted?' do + after(:each) { ENV['TRUSTED_NETWORKS'] = nil } + subject { IPService.ip_trusted?(ip) } context 'when the ip is nil' do From b7b46e9a826ad6f7f86e0a495451bad70a33780e Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 20 Aug 2019 15:54:28 +0200 Subject: [PATCH 2/3] Improve clone of procedure attachements --- app/models/procedure.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index 7871e6ac4..b669122a0 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -262,8 +262,10 @@ class Procedure < ApplicationRecord if original_attachment.attached? kopy.send(attribute).attach({ io: StringIO.new(original_attachment.download), - filename: original_attachment.blob.filename, - content_type: original_attachment.blob.content_type + filename: original_attachment.filename, + content_type: original_attachment.content_type, + # we don't want to run virus scanner on cloned file + metadata: { virus_scan_result: ActiveStorage::VirusScanner::SAFE } }) end end From 6215ccb3d77b1dfbdfbbf7fb09fdd705ff28970f Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 21 Aug 2019 10:48:49 +0200 Subject: [PATCH 3/3] Fix carte initialize --- app/javascript/new_design/champs/carte.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/new_design/champs/carte.js b/app/javascript/new_design/champs/carte.js index c4f8a3cb8..f91b3b0d5 100644 --- a/app/javascript/new_design/champs/carte.js +++ b/app/javascript/new_design/champs/carte.js @@ -39,7 +39,7 @@ function diplayMap(element, data, initial = false) { } } -addEventListener('ds:page:update', initialize); +addEventListener('turbolinks:load', initialize); addEventListener('carte:update', ({ detail: { selector, data } }) => { const element = document.querySelector(selector);