From 98bb4f71a0714a31c13de99646145bb6af5d898c Mon Sep 17 00:00:00 2001 From: mdorf Date: Mon, 7 Aug 2023 15:36:14 -0700 Subject: [PATCH] fixed an issue with the GA4 Analytics migration --- Gemfile.lock | 16 ++++++++-------- lib/ontologies_linked_data/models/ontology.rb | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5f77445a..b97e7266 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ncbo/goo.git - revision: fb203b0396d03c1df61abfcdbc4070787010f052 + revision: a3a5f20a75482b4d9e5ffe31d66831855422867a branch: develop specs: goo (0.0.2) @@ -32,7 +32,7 @@ GEM multi_json (~> 1.3) thread_safe (~> 0.1) tzinfo (~> 0.3.37) - addressable (2.8.4) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) ansi (1.5.0) ast (2.4.2) @@ -79,7 +79,7 @@ GEM net-pop net-smtp method_source (1.0.0) - mime-types (3.4.1) + mime-types (3.5.0) mime-types-data (~> 3.2015) mime-types-data (3.2023.0218.1) mini_mime (1.1.2) @@ -101,7 +101,7 @@ GEM net-smtp (0.3.3) net-protocol netrc (0.11.0) - oj (3.15.0) + oj (3.15.1) omni_logger (0.1.4) logger parallel (1.23.0) @@ -117,7 +117,7 @@ GEM method_source (~> 1.0) public_suffix (5.0.3) racc (1.7.1) - rack (2.2.7) + rack (2.2.8) rack-test (0.8.3) rack (>= 1.0, < 3) rainbow (3.1.1) @@ -126,7 +126,7 @@ GEM addressable (>= 2.2) redis (5.0.6) redis-client (>= 0.9.0) - redis-client (0.14.1) + redis-client (0.15.0) connection_pool regexp_parser (2.8.1) rest-client (2.1.0) @@ -138,7 +138,7 @@ GEM rsolr (2.5.0) builder (>= 2.1.2) faraday (>= 0.9, < 3, != 2.0.0) - rubocop (1.55.0) + rubocop (1.55.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -212,4 +212,4 @@ DEPENDENCIES thin BUNDLED WITH - 2.4.17 + 2.3.15 diff --git a/lib/ontologies_linked_data/models/ontology.rb b/lib/ontologies_linked_data/models/ontology.rb index d59a83ca..03cf6b5c 100644 --- a/lib/ontologies_linked_data/models/ontology.rb +++ b/lib/ontologies_linked_data/models/ontology.rb @@ -286,11 +286,11 @@ def self.analytics(year=nil, month=nil, acronyms=nil) unless analytics.empty? analytics.delete_if { |acronym, _| !acronyms.include? acronym } unless acronyms.nil? analytics.values.each do |ont_analytics| - ont_analytics.delete_if { |key, _| key != year } unless year.nil? - ont_analytics.each { |_, val| val.delete_if { |key, __| key != month } } unless month.nil? + ont_analytics.delete_if { |key, _| key != year.to_s } unless year.nil? + ont_analytics.each { |_, val| val.delete_if { |key, __| key != month.to_s } } unless month.nil? end # sort results by the highest traffic values - analytics = Hash[analytics.sort_by {|_, v| v[year][month]}.reverse] if year && month + analytics = Hash[analytics.sort_by {|_, v| v[year.to_s][month.to_s]}.reverse] if year && month end analytics end