From 9199d1cfbf3ec9059c4b19b06f697c652a56c729 Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Mon, 9 Oct 2023 11:04:20 +0200 Subject: [PATCH] fixed an issue with the GA4 Analytics migration --- Gemfile.lock | 20 +++++++++---------- lib/ontologies_linked_data/models/ontology.rb | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2ad30af1..5bae3a8f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ontoportal-lirmm/goo.git - revision: 1d78bde5a711d05475da0459308c7db074af5e21 + revision: 69466682c1e9cb2c338539195013dbec9714ca7d branch: development specs: goo (0.0.2) @@ -78,7 +78,7 @@ GEM faraday-patron (1.0.0) faraday-rack (1.0.0) faraday-retry (1.0.3) - ffi (1.15.5) + ffi (1.16.3) hashdiff (1.0.1) hashie (5.0.0) htmlentities (4.3.4) @@ -105,7 +105,7 @@ GEM method_source (1.0.0) mime-types (3.5.1) mime-types-data (~> 3.2015) - mime-types-data (3.2023.0808) + mime-types-data (3.2023.1003) mini_mime (1.1.5) minitest (4.7.5) minitest-reporters (0.14.24) @@ -116,21 +116,21 @@ GEM multi_json (1.15.0) multipart-post (2.3.0) net-http-persistent (2.9.4) - net-imap (0.3.7) + net-imap (0.4.0) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.1) timeout - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol netrc (0.11.0) oj (2.18.5) omni_logger (0.1.4) logger parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc pony (1.13.1) @@ -151,7 +151,7 @@ GEM addressable (>= 2.2) redis (5.0.7) redis-client (>= 0.9.0) - redis-client (0.16.0) + redis-client (0.17.0) connection_pool regexp_parser (2.8.1) request_store (1.5.1) @@ -164,7 +164,7 @@ GEM rexml (3.2.6) rsolr (1.1.2) builder (>= 2.1.2) - rubocop (1.56.1) + rubocop (1.56.4) base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -203,10 +203,10 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8.2) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) uuid (2.3.9) macaddr (~> 1.0) - webmock (3.18.1) + webmock (3.19.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) diff --git a/lib/ontologies_linked_data/models/ontology.rb b/lib/ontologies_linked_data/models/ontology.rb index 17275a26..9ff538ee 100644 --- a/lib/ontologies_linked_data/models/ontology.rb +++ b/lib/ontologies_linked_data/models/ontology.rb @@ -339,11 +339,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