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); 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 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