From a209139b53e92a623f5c700daf3dca09a3aacce5 Mon Sep 17 00:00:00 2001 From: Nick Budak Date: Wed, 29 Mar 2023 11:08:59 -0700 Subject: [PATCH] Use strings instead of symbols for consistency in harvester Both the #repositories method and the #record_repo method return strings, so it's easier to just transform @ogm_repos to use string keys than trying to force everything to be symbols. --- lib/earthworks/harvester.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/earthworks/harvester.rb b/lib/earthworks/harvester.rb index b7bfeb9e..a336d48f 100644 --- a/lib/earthworks/harvester.rb +++ b/lib/earthworks/harvester.rb @@ -9,7 +9,7 @@ class Harvester < GeoCombine::Harvester def initialize(ogm_repos: ENV.fetch('OGM_REPOS'), **kwargs) super(**kwargs) - @ogm_repos = ogm_repos + @ogm_repos = ogm_repos.transform_keys(&:to_s) end # Support skipping and transforming arbitrary records prior to indexing @@ -49,7 +49,7 @@ def record_repo(path) # Only harvest configured repositories, if configuration was provided def repositories - @repositories ||= @ogm_repos ? super.compact.select { |repo| @ogm_repos.key?(repo.to_sym) } : super + @repositories ||= @ogm_repos ? super.compact.select { |repo| @ogm_repos.key?(repo) } : super end end end