Skip to content

Commit

Permalink
Use strings instead of symbols for consistency in harvester
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thatbudakguy committed Mar 29, 2023
1 parent babdc24 commit a209139
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/earthworks/harvester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit a209139

Please sign in to comment.