From 21d723612ff7e97875020d656b5203a60f54cc57 Mon Sep 17 00:00:00 2001 From: stevemelamed Date: Thu, 10 Mar 2022 11:00:24 -0330 Subject: [PATCH] updaing code per Jleger's recommendation --- lib/slackify/configuration.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/slackify/configuration.rb b/lib/slackify/configuration.rb index 05943d0..78a6a43 100644 --- a/lib/slackify/configuration.rb +++ b/lib/slackify/configuration.rb @@ -71,7 +71,11 @@ def generate_handlers def read_handlers_yaml raise 'config/handlers.yml does not exist' unless File.exist?("#{Rails.root}/config/handlers.yml") - YAML.load_file("#{Rails.root}/config/handlers.yml") || [] + if YAML.respond_to?(:unsafe_load_file) + YAML.unsafe_load_file(Rails.root.join("config/handlers.yml")) || [] + else + YAML.load_file("#{Rails.root}/config/handlers.yml") || [] + end end end end