From 9c7fb25edc0263b8ad1b9d95ba6570747c9c626e Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 08:41:46 -0600 Subject: [PATCH 01/48] Update Gem dependencies to succeed for Rails 7.1 bundle update. --- Gemfile | 4 +- Gemfile.lock | 176 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 106 insertions(+), 74 deletions(-) diff --git a/Gemfile b/Gemfile index b1b2262b8b..afb35d1cbc 100644 --- a/Gemfile +++ b/Gemfile @@ -7,9 +7,9 @@ ruby '>= 3.2', '< 3.3.0' gem 'bundler', '~> 2.0' gem 'rake', '~> 13.0' -gem 'rails', '~> 6.1' +gem 'rails', ' 7.1' gem 'pg', '~> 1.1' -gem 'activerecord-postgis-adapter', '~> 7.0' +gem 'activerecord-postgis-adapter', '~> 9.0' gem 'hiredis', '~> 0.6.1' gem 'redis', '~> 4.5' diff --git a/Gemfile.lock b/Gemfile.lock index cec4cb2914..3f8f9efd23 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -83,68 +83,82 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.1.0) - actioncable (6.1.7.6) - actionpack (= 6.1.7.6) - activesupport (= 6.1.7.6) + actioncable (7.1.0) + actionpack (= 7.1.0) + activesupport (= 7.1.0) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.6) - actionpack (= 6.1.7.6) - activejob (= 6.1.7.6) - activerecord (= 6.1.7.6) - activestorage (= 6.1.7.6) - activesupport (= 6.1.7.6) + zeitwerk (~> 2.6) + actionmailbox (7.1.0) + actionpack (= 7.1.0) + activejob (= 7.1.0) + activerecord (= 7.1.0) + activestorage (= 7.1.0) + activesupport (= 7.1.0) mail (>= 2.7.1) - actionmailer (6.1.7.6) - actionpack (= 6.1.7.6) - actionview (= 6.1.7.6) - activejob (= 6.1.7.6) - activesupport (= 6.1.7.6) + net-imap + net-pop + net-smtp + actionmailer (7.1.0) + actionpack (= 7.1.0) + actionview (= 7.1.0) + activejob (= 7.1.0) + activesupport (= 7.1.0) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (6.1.7.6) - actionview (= 6.1.7.6) - activesupport (= 6.1.7.6) - rack (~> 2.0, >= 2.0.9) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.2) + actionpack (7.1.0) + actionview (= 7.1.0) + activesupport (= 7.1.0) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.6) - actionpack (= 6.1.7.6) - activerecord (= 6.1.7.6) - activestorage (= 6.1.7.6) - activesupport (= 6.1.7.6) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.0) + actionpack (= 7.1.0) + activerecord (= 7.1.0) + activestorage (= 7.1.0) + activesupport (= 7.1.0) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.7.6) - activesupport (= 6.1.7.6) + actionview (7.1.0) + activesupport (= 7.1.0) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.7.6) - activesupport (= 6.1.7.6) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.0) + activesupport (= 7.1.0) globalid (>= 0.3.6) - activemodel (6.1.7.6) - activesupport (= 6.1.7.6) - activerecord (6.1.7.6) - activemodel (= 6.1.7.6) - activesupport (= 6.1.7.6) - activerecord-postgis-adapter (7.1.1) - activerecord (~> 6.1) + activemodel (7.1.0) + activesupport (= 7.1.0) + activerecord (7.1.0) + activemodel (= 7.1.0) + activesupport (= 7.1.0) + timeout (>= 0.4.0) + activerecord-postgis-adapter (9.0.1) + activerecord (~> 7.1.0) rgeo-activerecord (~> 7.0.0) - activestorage (6.1.7.6) - actionpack (= 6.1.7.6) - activejob (= 6.1.7.6) - activerecord (= 6.1.7.6) - activesupport (= 6.1.7.6) + activestorage (7.1.0) + actionpack (= 7.1.0) + activejob (= 7.1.0) + activerecord (= 7.1.0) + activesupport (= 7.1.0) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (6.1.7.6) + activesupport (7.1.0) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) - zeitwerk (~> 2.3) acts_as_list (1.1.0) activerecord (>= 4.2) addressable (2.8.6) @@ -204,7 +218,8 @@ GEM faraday-follow_redirects (>= 0.1, < 0.4) multi_json (~> 1.15) concurrent-ruby (1.2.3) - crack (0.4.6) + connection_pool (2.4.1) + crack (1.0.0) bigdecimal rexml crass (1.0.6) @@ -230,9 +245,11 @@ GEM diff-lcs (1.5.1) docile (1.4.0) domain_name (0.6.20240107) + drb (2.2.0) + ruby2_keywords dropzonejs-rails (0.8.5) rails (> 3.1) - dwc_agent (3.1.0.0) + dwc_agent (3.1.1.0) namae (~> 1) namecase (~> 2) erubi (1.12.0) @@ -292,6 +309,10 @@ GEM concurrent-ruby (~> 1.0) indefinite_article (0.2.5) activesupport + io-console (0.7.2) + irb (1.11.2) + rdoc + reline (>= 0.4.2) jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) @@ -347,6 +368,7 @@ GEM minitest (5.22.2) modularity (3.0.1) multi_json (1.15.0) + mutex_m (0.2.0) namae (1.2.0) racc (~> 1.7) namecase (2.0.0) @@ -417,23 +439,27 @@ GEM rack (>= 2.0.0) rack-proxy (0.7.7) rack + rack-session (1.0.2) + rack (< 3) rack-test (2.1.0) rack (>= 1.3) - rails (6.1.7.6) - actioncable (= 6.1.7.6) - actionmailbox (= 6.1.7.6) - actionmailer (= 6.1.7.6) - actionpack (= 6.1.7.6) - actiontext (= 6.1.7.6) - actionview (= 6.1.7.6) - activejob (= 6.1.7.6) - activemodel (= 6.1.7.6) - activerecord (= 6.1.7.6) - activestorage (= 6.1.7.6) - activesupport (= 6.1.7.6) + rackup (1.0.0) + rack (< 3) + webrick + rails (7.1.0) + actioncable (= 7.1.0) + actionmailbox (= 7.1.0) + actionmailer (= 7.1.0) + actionpack (= 7.1.0) + actiontext (= 7.1.0) + actionview (= 7.1.0) + activejob (= 7.1.0) + activemodel (= 7.1.0) + activerecord (= 7.1.0) + activestorage (= 7.1.0) + activesupport (= 7.1.0) bundler (>= 1.15.0) - railties (= 6.1.7.6) - sprockets-rails (>= 2.0.0) + railties (= 7.1.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -449,12 +475,14 @@ GEM rails (>= 3.2) rails_or (1.1.9) activerecord (>= 3) - railties (6.1.7.6) - actionpack (= 6.1.7.6) - activesupport (= 6.1.7.6) - method_source + railties (7.1.0) + actionpack (= 7.1.0) + activesupport (= 7.1.0) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.0.0) rake (13.1.0) rb-fsevent (0.11.2) @@ -467,6 +495,8 @@ GEM redcarpet (3.6.0) redis (4.8.1) regexp_parser (2.9.0) + reline (0.4.2) + io-console (~> 0.5) request_store (1.6.0) rack (>= 1.4) require_all (3.0.0) @@ -488,7 +518,7 @@ GEM rgeo (>= 1.0.0) rgeo-proj4 (4.0.0) rgeo (~> 3.0.0) - rmagick (5.4.1) + rmagick (5.4.2) observer (~> 0.1) pkg-config (~> 1.4) roo (2.10.1) @@ -565,6 +595,7 @@ GEM ruby-progressbar (1.13.0) ruby-rc4 (0.1.5) ruby-units (2.3.2) + ruby2_keywords (0.0.5) rubyzip (2.3.2) sassc (2.4.0) ffi (~> 1.9) @@ -662,6 +693,7 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) + webrick (1.8.1) websocket (1.2.10) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) @@ -686,7 +718,7 @@ PLATFORMS x86_64-linux DEPENDENCIES - activerecord-postgis-adapter (~> 7.0) + activerecord-postgis-adapter (~> 9.0) acts_as_list (~> 1.0) amazing_print (~> 1.4.0) asciidoctor (~> 2.0) @@ -753,7 +785,7 @@ DEPENDENCIES psych (~> 3.3) puma (~> 6.3) rack-cors (~> 2.0) - rails (~> 6.1) + rails (= 7.1) rails-controller-testing (~> 1.0.2) rails-jquery-autocomplete (~> 1.0.3) rails_or (~> 1.1.8) From 199fdef1f604ce757aa4c210b39ba2a228b4217f Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 10:20:22 -0600 Subject: [PATCH 02/48] Update Gemfile.lock --- Gemfile.lock | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3f8f9efd23..b10f993dc0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -386,6 +386,14 @@ GEM net-protocol netrc (0.11.0) nio4r (2.7.0) + nokogiri (1.16.2-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.2-arm-linux) + racc (~> 1.4) + nokogiri (1.16.2-arm64-darwin) + racc (~> 1.4) + nokogiri (1.16.2-x86-linux) + racc (~> 1.4) nokogiri (1.16.2-x86_64-darwin) racc (~> 1.4) nokogiri (1.16.2-x86_64-linux) @@ -713,8 +721,11 @@ GEM zip_tricks (5.6.0) PLATFORMS - x86_64-darwin-20 - x86_64-darwin-22 + aarch64-linux + arm-linux + arm64-darwin + x86-linux + x86_64-darwin x86_64-linux DEPENDENCIES @@ -847,7 +858,7 @@ DEPENDENCIES zip_tricks (~> 5.6) RUBY VERSION - ruby 3.2.1p31 + ruby 3.3.0p0 BUNDLED WITH - 2.4.10 + 2.5.3 From 5fd055a3d1a4e2a0b7e4ffc124d4f64e77f1cf41 Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 10:23:23 -0600 Subject: [PATCH 03/48] Allow 7.1.3 --- Gemfile | 2 +- Gemfile.lock | 109 ++++++++++++++++++++++++++------------------------- 2 files changed, 56 insertions(+), 55 deletions(-) diff --git a/Gemfile b/Gemfile index 1d3dae41a4..a207434122 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ ruby '>= 3.2', '< 3.4.0' gem 'bundler', '~> 2.0' gem 'rake', '~> 13.0' -gem 'rails', ' 7.1' +gem 'rails', '~> 7.1' gem 'pg', '~> 1.1' gem 'activerecord-postgis-adapter', '~> 9.0' gem 'hiredis', '~> 0.6.1' diff --git a/Gemfile.lock b/Gemfile.lock index b10f993dc0..c2b80a5d79 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -83,73 +83,74 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.1.0) - actioncable (7.1.0) - actionpack (= 7.1.0) - activesupport (= 7.1.0) + actioncable (7.1.3) + actionpack (= 7.1.3) + activesupport (= 7.1.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.0) - actionpack (= 7.1.0) - activejob (= 7.1.0) - activerecord (= 7.1.0) - activestorage (= 7.1.0) - activesupport (= 7.1.0) + actionmailbox (7.1.3) + actionpack (= 7.1.3) + activejob (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.0) - actionpack (= 7.1.0) - actionview (= 7.1.0) - activejob (= 7.1.0) - activesupport (= 7.1.0) + actionmailer (7.1.3) + actionpack (= 7.1.3) + actionview (= 7.1.3) + activejob (= 7.1.3) + activesupport (= 7.1.3) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.0) - actionview (= 7.1.0) - activesupport (= 7.1.0) + actionpack (7.1.3) + actionview (= 7.1.3) + activesupport (= 7.1.3) nokogiri (>= 1.8.5) + racc rack (>= 2.2.4) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.0) - actionpack (= 7.1.0) - activerecord (= 7.1.0) - activestorage (= 7.1.0) - activesupport (= 7.1.0) + actiontext (7.1.3) + actionpack (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.0) - activesupport (= 7.1.0) + actionview (7.1.3) + activesupport (= 7.1.3) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.0) - activesupport (= 7.1.0) + activejob (7.1.3) + activesupport (= 7.1.3) globalid (>= 0.3.6) - activemodel (7.1.0) - activesupport (= 7.1.0) - activerecord (7.1.0) - activemodel (= 7.1.0) - activesupport (= 7.1.0) + activemodel (7.1.3) + activesupport (= 7.1.3) + activerecord (7.1.3) + activemodel (= 7.1.3) + activesupport (= 7.1.3) timeout (>= 0.4.0) activerecord-postgis-adapter (9.0.1) activerecord (~> 7.1.0) rgeo-activerecord (~> 7.0.0) - activestorage (7.1.0) - actionpack (= 7.1.0) - activejob (= 7.1.0) - activerecord (= 7.1.0) - activesupport (= 7.1.0) + activestorage (7.1.3) + actionpack (= 7.1.3) + activejob (= 7.1.3) + activerecord (= 7.1.3) + activesupport (= 7.1.3) marcel (~> 1.0) - activesupport (7.1.0) + activesupport (7.1.3) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -454,20 +455,20 @@ GEM rackup (1.0.0) rack (< 3) webrick - rails (7.1.0) - actioncable (= 7.1.0) - actionmailbox (= 7.1.0) - actionmailer (= 7.1.0) - actionpack (= 7.1.0) - actiontext (= 7.1.0) - actionview (= 7.1.0) - activejob (= 7.1.0) - activemodel (= 7.1.0) - activerecord (= 7.1.0) - activestorage (= 7.1.0) - activesupport (= 7.1.0) + rails (7.1.3) + actioncable (= 7.1.3) + actionmailbox (= 7.1.3) + actionmailer (= 7.1.3) + actionpack (= 7.1.3) + actiontext (= 7.1.3) + actionview (= 7.1.3) + activejob (= 7.1.3) + activemodel (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) bundler (>= 1.15.0) - railties (= 7.1.0) + railties (= 7.1.3) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -483,9 +484,9 @@ GEM rails (>= 3.2) rails_or (1.1.9) activerecord (>= 3) - railties (7.1.0) - actionpack (= 7.1.0) - activesupport (= 7.1.0) + railties (7.1.3) + actionpack (= 7.1.3) + activesupport (= 7.1.3) irb rackup (>= 1.0.0) rake (>= 12.2) @@ -796,7 +797,7 @@ DEPENDENCIES psych (~> 3.3) puma (~> 6.3) rack-cors (~> 2.0) - rails (= 7.1) + rails (~> 7.1) rails-controller-testing (~> 1.0.2) rails-jquery-autocomplete (~> 1.0.3) rails_or (~> 1.1.8) From 3757c6c9dba67ecd18a5d4ac1f5fe8fc17913967 Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 10:25:12 -0600 Subject: [PATCH 04/48] Update psych gem --- Gemfile | 2 +- Gemfile.lock | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index a207434122..8e7070631c 100644 --- a/Gemfile +++ b/Gemfile @@ -22,7 +22,7 @@ gem 'rubyzip', '~> 2.3.0' gem 'zip_tricks', '~> 5.6' gem 'daemons', '~> 1.4.1' gem 'tzinfo-data', '~> 1.2019' # , '>= 1.2019.3' -gem 'psych', '~> 3.3' +gem 'psych', '~> 5.1' gem 'rmagick', '~> 5.1' # , '>= 4.2.2' gem 'roo', '~> 2.8', '>= 2.8.3' gem 'roo-xls', '~> 1.2' diff --git a/Gemfile.lock b/Gemfile.lock index c2b80a5d79..836ca6fef5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -438,7 +438,8 @@ GEM pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - psych (3.3.4) + psych (5.1.2) + stringio public_suffix (5.0.4) puma (6.4.2) nio4r (~> 2.0) @@ -500,7 +501,8 @@ GEM rdf (3.3.1) bcp47_spec (~> 0.2) link_header (~> 0.0, >= 0.0.8) - rdoc (6.3.3) + rdoc (6.6.2) + psych (>= 4.0.0) redcarpet (3.6.0) redis (4.8.1) regexp_parser (2.9.0) @@ -660,6 +662,7 @@ GEM rake (~> 13.0) rmagick (~> 5.2) rtesseract (~> 3.1) + stringio (3.1.0) sync (0.5.0) taxonifi (0.6.0) require_all (~> 3.0) @@ -794,7 +797,7 @@ DEPENDENCIES pg (~> 1.1) postgresql_cursor (~> 0.6.1) prawn (~> 2.4.0) - psych (~> 3.3) + psych (~> 5.1) puma (~> 6.3) rack-cors (~> 2.0) rails (~> 7.1) From 9d3ce9183f3d4ad2fa230af332847e9fe33db084 Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 10:27:15 -0600 Subject: [PATCH 05/48] Update rspec-rails gem to ~> 6.1 --- Gemfile | 2 +- Gemfile.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 8e7070631c..d310a0b7bf 100644 --- a/Gemfile +++ b/Gemfile @@ -154,7 +154,7 @@ gem 'ruby-progressbar', '~> 1.11' group :test, :development do gem 'faker', '~> 2.10' - gem 'rspec-rails', '~> 5.0' + gem 'rspec-rails', '~> 6.1' gem 'rspec-activemodel-mocks', '~> 1.1.0' gem 'byebug', '~> 11.1', {}.merge(ENV['RM_INFO'] ? {require: false} : {}) gem 'factory_bot_rails', '~> 6.2' diff --git a/Gemfile.lock b/Gemfile.lock index 836ca6fef5..c1eece8ae7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -557,14 +557,14 @@ GEM rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (5.1.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - railties (>= 5.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) + rspec-rails (6.1.1) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) rspec-support (3.13.0) rtesseract (3.1.3) rubocop (1.60.2) @@ -820,7 +820,7 @@ DEPENDENCIES rqrcode! rspec (~> 3.6) rspec-activemodel-mocks (~> 1.1.0) - rspec-rails (~> 5.0) + rspec-rails (~> 6.1) rubocop (~> 1.20) rubocop-faker (~> 1.1) rubocop-performance (~> 1.10) From 3f57d6bf98737b396f2bcb2af4d78383811f65fa Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 10:39:40 -0600 Subject: [PATCH 06/48] Update bundler and add CSV gem --- Gemfile | 6 +++++- Gemfile.lock | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index d310a0b7bf..67f1421b00 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ gem 'rack-cors', '~> 2.0', require: 'rack/cors' ruby '>= 3.2', '< 3.4.0' -gem 'bundler', '~> 2.0' +gem 'bundler', '~> 2.5' gem 'rake', '~> 13.0' gem 'rails', '~> 7.1' @@ -27,6 +27,9 @@ gem 'rmagick', '~> 5.1' # , '>= 4.2.2' gem 'roo', '~> 2.8', '>= 2.8.3' gem 'roo-xls', '~> 1.2' +gem 'csv', '~> 3.2' + + gem 'net-smtp', '~> 0.3.1' gem 'mail', '~> 2.8', '>= 2.8.1' gem 'matrix', '~> 0.4.2' @@ -67,6 +70,7 @@ gem 'delayed_job_active_record', '~> 4.1.3' # This is likely not the real propegated error, see similar https://github.com/Shopify/bootsnap/issues/218 # version 6 beta out now gem 'validates_timeliness', '~> 4.1', '>= 4.1.1' + gem 'paper_trail', '~> 12.0' gem 'acts_as_list', '~> 1.0' gem 'modularity', '~> 3.0.0' # TODO: Used!? diff --git a/Gemfile.lock b/Gemfile.lock index c1eece8ae7..e540d4301f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -229,6 +229,7 @@ GEM rexml csl-styles (1.0.1.11) csl (~> 1.0) + csv (3.2.8) daemons (1.4.1) database_cleaner (2.0.2) database_cleaner-active_record (>= 2, < 3) @@ -745,7 +746,7 @@ DEPENDENCIES binding_of_caller biodiversity! brakeman (~> 5.1, >= 4.6.1) - bundler (~> 2.0) + bundler (~> 2.5) byebug (~> 11.1) capybara (~> 3.18) chartkick (~> 4.0) @@ -757,6 +758,7 @@ DEPENDENCIES colrapi (~> 0.1.1) csl (~> 1.6.0) csl-styles (~> 1.0.1.8) + csv (~> 3.2) daemons (~> 1.4.1) database_cleaner (~> 2.0) delayed_job_active_record (~> 4.1.3) From a7233e3fc7ac9056e0955a461b0d7c6c35ce2dfa Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 10:43:12 -0600 Subject: [PATCH 07/48] Use validates_timeliness-7.0.0.beta2 --- Gemfile | 5 ++++- Gemfile.lock | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 67f1421b00..c8c15d5112 100644 --- a/Gemfile +++ b/Gemfile @@ -69,7 +69,10 @@ gem 'delayed_job_active_record', '~> 4.1.3' # TODO: updating to 5.0 causes "NoMethodError: undefined method `has_attached_file' for Image:Class" # This is likely not the real propegated error, see similar https://github.com/Shopify/bootsnap/issues/218 # version 6 beta out now -gem 'validates_timeliness', '~> 4.1', '>= 4.1.1' + +gem 'validates_timeliness', '~> 7.0.0.beta2' # , '>= 4.1.1' + + gem 'paper_trail', '~> 12.0' gem 'acts_as_list', '~> 1.0' diff --git a/Gemfile.lock b/Gemfile.lock index e540d4301f..32a62db8d6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -692,7 +692,8 @@ GEM execjs (>= 0.3.0, < 3) unicode-display_width (2.5.0) uri (0.13.0) - validates_timeliness (4.1.1) + validates_timeliness (7.0.0.beta2) + activemodel (>= 7.0.0, < 8) timeliness (>= 0.3.10, < 1) vcr (6.2.0) waxy (0.1.1) @@ -853,7 +854,7 @@ DEPENDENCIES turbolinks (~> 5.2.0) tzinfo-data (~> 1.2019) uglifier (~> 4.2) - validates_timeliness (~> 4.1, >= 4.1.1) + validates_timeliness (~> 7.0.0.beta2) vcr (~> 6.0) voight_kampff! waxy (~> 0.1.1) From 74afd24bc863feb691833b4c9daea137169ce6f7 Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 10:44:36 -0600 Subject: [PATCH 08/48] Disable deprecation silencing --- config/initializers/silence_deprecations.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/initializers/silence_deprecations.rb b/config/initializers/silence_deprecations.rb index e9ca025136..e28de76759 100644 --- a/config/initializers/silence_deprecations.rb +++ b/config/initializers/silence_deprecations.rb @@ -1,5 +1,5 @@ -current_behavior = ActiveSupport::Deprecation.behavior -ActiveSupport::Deprecation.behavior = lambda do |message, callstack, deprecation_horizon, gem_name| - return if message =~ /`serialized_attributes` is deprecated without replacement/ && callstack.any? { |m| m =~ /paper_trail/ } - Array.wrap(current_behavior).each { |behavior| behavior.call(message, callstack, deprecation_horizon, gem_name) } -end +# current_behavior = ActiveSupport::Deprecation.behavior +# ActiveSupport::Deprecation.behavior = lambda do |message, callstack, deprecation_horizon, gem_name| +# return if message =~ /`serialized_attributes` is deprecated without replacement/ && callstack.any? { |m| m =~ /paper_trail/ } +# Array.wrap(current_behavior).each { |behavior| behavior.call(message, callstack, deprecation_horizon, gem_name) } +# end From d0505e69268badd635391a091c6544caf986b7ca Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 10:47:21 -0600 Subject: [PATCH 09/48] Update amazing_print and rainbow gems --- Gemfile | 4 ++-- Gemfile.lock | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index c8c15d5112..3ecb5f6c37 100644 --- a/Gemfile +++ b/Gemfile @@ -137,9 +137,9 @@ gem 'colrapi', '~>0.1.1' gem 'gnfinder', '~> 1.0' # Minor Utils/helpers -gem 'amazing_print', '~> 1.4.0' +gem 'amazing_print', '~> 1.5' gem 'indefinite_article', '~> 0.2.4' -gem 'rainbow', '~> 3.0.0' +gem 'rainbow', '~> 3.0' gem 'term-ansicolor', '~> 1.6' # DEPRECATED gem 'chronic', '~> 0.10.2' gem 'logical_query_parser' diff --git a/Gemfile.lock b/Gemfile.lock index 32a62db8d6..176a647095 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -165,7 +165,7 @@ GEM addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) afm (0.2.2) - amazing_print (1.4.0) + amazing_print (1.5.0) asciidoctor (2.0.20) ast (2.4.2) babel-source (5.8.35) @@ -494,7 +494,7 @@ GEM rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) - rainbow (3.0.0) + rainbow (3.1.1) rake (13.1.0) rb-fsevent (0.11.2) rb-inotify (0.10.1) @@ -737,7 +737,7 @@ PLATFORMS DEPENDENCIES activerecord-postgis-adapter (~> 9.0) acts_as_list (~> 1.0) - amazing_print (~> 1.4.0) + amazing_print (~> 1.5) asciidoctor (~> 2.0) barby (~> 0.6.8) bcrypt (~> 3.1.11) @@ -807,7 +807,7 @@ DEPENDENCIES rails-controller-testing (~> 1.0.2) rails-jquery-autocomplete (~> 1.0.3) rails_or (~> 1.1.8) - rainbow (~> 3.0.0) + rainbow (~> 3.0) rake (~> 13.0) rdf (~> 3.0) redcarpet (~> 3.4) From 86f2d1e37d3d9aa4864e22f5bcd847ccd7b1c956 Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 13:32:00 -0600 Subject: [PATCH 10/48] Bump paperclip gem --- Gemfile | 3 ++- Gemfile.lock | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 3ecb5f6c37..222e29e908 100644 --- a/Gemfile +++ b/Gemfile @@ -74,7 +74,8 @@ gem 'validates_timeliness', '~> 7.0.0.beta2' # , '>= 4.1.1' -gem 'paper_trail', '~> 12.0' +gem 'paper_trail', '~> 15.0' + gem 'acts_as_list', '~> 1.0' gem 'modularity', '~> 3.0.0' # TODO: Used!? gem 'paperclip', github: 'LocoDelAssembly/paperclip', branch: 'migration-fix' # gem 'paperclip', '~> 6.1.0' diff --git a/Gemfile.lock b/Gemfile.lock index 176a647095..be8aa5918e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -406,9 +406,9 @@ GEM observer (0.1.2) os (1.1.4) package_json (0.1.0) - paper_trail (12.3.0) - activerecord (>= 5.2) - request_store (~> 1.1) + paper_trail (15.1.0) + activerecord (>= 6.1) + request_store (~> 1.4) paperclip-meta (3.1.0) paperclip (>= 5.0) parallel (1.24.0) @@ -790,7 +790,7 @@ DEPENDENCIES namecase (~> 2.0) net-smtp (~> 0.3.1) os (~> 1.0, >= 1.0.1) - paper_trail (~> 12.0) + paper_trail (~> 15.0) paperclip! paperclip-meta (~> 3.0) parallel (~> 1.23) From 6c5bd51c8f5f6ea739990067ae48aecaea311d1e Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 13:43:56 -0600 Subject: [PATCH 11/48] Stub all 7.1 settings for testing --- config/application.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/config/application.rb b/config/application.rb index a85790e547..f4e969149a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -13,6 +13,37 @@ class Application < Rails::Application # This breaks housekeeping when on but might be needed # config.load_defaults 6.1 + config.load_defaults 7.1 + + # With no settings set: + +# config.action_controller.allow_deprecated_parameters_hash_equality = nil +# config.action_dispatch.debug_exception_log_level = :fatal # (not :error) +# config.action_text.sanitizer_vendor = nil +# config.active_job.use_big_decimal_serializer = nil +# config.active_record.allow_deprecated_singular_associations_name = nil +# config.active_record.before_committed_on_all_records = nil +# config.active_record.belongs_to_required_validates_foreign_key = false # false # !! false in 7.1 +# config.active_record.commit_transaction_on_non_local_return = nil +# config.active_record.default_column_serializer = nil +# config.active_record.encryption.hash_digest_class = nil +# config.active_record.encryption.support_sha1_for_non_deterministic_encryption = nil +# config.active_record.generate_secure_token_on = :create # !! (is :initialize in 7.1) +# # config.active_record.marshalling_format_version = nil +# config.active_record.query_log_tags_format = :legacy # !! (is :sqlcommenter in 7.1) +# config.active_record.raise_on_assign_to_attr_readonly = false # !! (is true in 7.1) +# config.active_record.run_after_transaction_callbacks_in_order_defined = nil # (true in 7.1) +# config.active_record.run_commit_callbacks_on_first_saved_instances_in_transaction = nil # (false in 7.1) +# config.active_record.sqlite3_adapter_strict_strings_by_default = nil +# config.active_support.cache_format_version = nil +# config.active_support.message_serializer = nil +# config.active_support.raise_on_invalid_cache_expiration_time = nil +# config.active_support.use_message_serializer_for_metadata = nil +# config.add_autoload_paths_to_load_path = true # !! (this must be it, false in 7.1) +# config.dom_testing_default_html_version = :html4 # !! (Nokogiri/HTML 5 options here) +# config.precompile_filter_parameters = nil + + # Via https://github.com/matthuhiggins/foreigner/pull/95 # config.before_initialize do # Foreigner::Adapter.register 'postgis', 'foreigner/connection_adapters/postgresql_adapter' From 6de393ac535bea0c4a20b84e22aee6d2ef70cec8 Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 14:06:15 -0600 Subject: [PATCH 12/48] In which we learn about belongs_to optional: true --- config/application.rb | 11 +++++++---- lib/housekeeping/users.rb | 10 ++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/config/application.rb b/config/application.rb index f4e969149a..72c6265372 100644 --- a/config/application.rb +++ b/config/application.rb @@ -15,21 +15,24 @@ class Application < Rails::Application config.load_defaults 7.1 - # With no settings set: + # TODO: confirm 7.1 settings are meaningful + config.active_record.belongs_to_required_by_default = false + # TODO: remove after testing + # With no settings set: # config.action_controller.allow_deprecated_parameters_hash_equality = nil # config.action_dispatch.debug_exception_log_level = :fatal # (not :error) # config.action_text.sanitizer_vendor = nil # config.active_job.use_big_decimal_serializer = nil # config.active_record.allow_deprecated_singular_associations_name = nil # config.active_record.before_committed_on_all_records = nil -# config.active_record.belongs_to_required_validates_foreign_key = false # false # !! false in 7.1 +# config.active_record.belongs_to_required_validates_foreign_key = false # false # !! false in 7.1 # config.active_record.commit_transaction_on_non_local_return = nil # config.active_record.default_column_serializer = nil # config.active_record.encryption.hash_digest_class = nil # config.active_record.encryption.support_sha1_for_non_deterministic_encryption = nil # config.active_record.generate_secure_token_on = :create # !! (is :initialize in 7.1) -# # config.active_record.marshalling_format_version = nil +# config.active_record.marshalling_format_version = nil # config.active_record.query_log_tags_format = :legacy # !! (is :sqlcommenter in 7.1) # config.active_record.raise_on_assign_to_attr_readonly = false # !! (is true in 7.1) # config.active_record.run_after_transaction_callbacks_in_order_defined = nil # (true in 7.1) @@ -39,7 +42,7 @@ class Application < Rails::Application # config.active_support.message_serializer = nil # config.active_support.raise_on_invalid_cache_expiration_time = nil # config.active_support.use_message_serializer_for_metadata = nil -# config.add_autoload_paths_to_load_path = true # !! (this must be it, false in 7.1) +# config.add_autoload_paths_to_load_path = true # !! (this must be it, false in 7.1) # config.dom_testing_default_html_version = :html4 # !! (Nokogiri/HTML 5 options here) # config.precompile_filter_parameters = nil diff --git a/lib/housekeeping/users.rb b/lib/housekeeping/users.rb index b986f921d5..e619eaf7db 100644 --- a/lib/housekeeping/users.rb +++ b/lib/housekeeping/users.rb @@ -9,13 +9,9 @@ module Housekeeping::Users belongs_to :creator, foreign_key: :created_by_id, class_name: 'User', inverse_of: "created_#{related_instances}".to_sym belongs_to :updater, foreign_key: :updated_by_id, class_name: 'User', inverse_of: "updated_#{related_instances}".to_sym -# scope :created_by_user, ->(user) { where(created_by_id: User.get_user_id(user) ) } -# scope :updated_by_user, ->(user) { where(updated_by_id: User.get_user_id(user) ) } - - scope :created_or_updated_by, -> (user_id) { where(created_by_id: user_id).or(where(updated_by_id: user_id)) } - unless_user = lambda { self.class.name == 'User' && self.self_created } - validates :creator, presence: true, unless: unless_user # lambda, proc, or block + + validates :creator, presence: true, unless: unless_user validates :updater, presence: true, unless: unless_user before_validation(on: :create, unless: unless_user) do @@ -27,6 +23,8 @@ module Housekeeping::Users set_updated_by_id end + scope :created_or_updated_by, -> (user_id) { where(created_by_id: user_id).or(where(updated_by_id: user_id)) } + # And extend User User.class_eval do raise 'Class name collision for User#has_many' if self.methods and self.methods.include?(:related_instances) From a2cfb5b16f38e03826fd9ea77a77f2d85cf069fc Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 14:33:16 -0600 Subject: [PATCH 13/48] Use native production check --- config/initializers/session_store.rb | 4 ++-- spec/support/controller_spec_helper.rb | 24 +++++++++++------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index d5b684fc4d..6e4f8fb9f7 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,7 +1,7 @@ # Be sure to restart your server when you modify this file. TaxonWorks::Application.config.session_store( - :cookie_store, + :cookie_store, key: '_TaxonWorks_session', - expire_after: (Rails.env.to_s == 'production' ? 24.hours : 14.days) + expire_after: (Rails.env.production? ? 24.hours : 14.days) ) diff --git a/spec/support/controller_spec_helper.rb b/spec/support/controller_spec_helper.rb index f129450042..6d5e2c68bd 100644 --- a/spec/support/controller_spec_helper.rb +++ b/spec/support/controller_spec_helper.rb @@ -1,27 +1,27 @@ # Helpers for controller specs (typically those automatically generated). -# +# # These methods should be used within a before(:each) block. module ControllerSpecHelper def sign_in_user_and_select_project(user, project_id) - @request.session = {project_id: project_id} + @request.session = ActionController::TestSession.new(project_id: 1) remember_token = User.secure_random_token cookies.permanent[:remember_token] = remember_token - user.update_attribute(:remember_token, User.encrypt(remember_token)) + user.update_attribute(:remember_token, User.encrypt(remember_token)) set_user_project(user.id,project_id) end # Signs in user 1 and project 1. def sign_in - @request.session = {project_id: 1} + @request.session = ActionController::TestSession.new(project_id: 1) remember_token = User.secure_random_token cookies.permanent[:remember_token] = remember_token - User.find(1).update_attribute(:remember_token, User.encrypt(remember_token)) + User.find(1).update_attribute(:remember_token, User.encrypt(remember_token)) set_user_project(1,1) end def sign_in_administrator - @request.session = {project_id: 1} + @request.session = ActionController::TestSession.new(project_id: 1) remember_token = User.secure_random_token cookies.permanent[:remember_token] = remember_token @@ -33,23 +33,23 @@ def sign_in_administrator end def sign_in_project_administrator - @request.session = {project_id: 1} + @request.session = ActionController::TestSession.new(project_id: 1) remember_token = User.secure_random_token cookies.permanent[:remember_token] = remember_token pwd = 'abcD123!' user = User.create!(name: 'Administrator (controller tests)', email: 'foo@bar.com', password: pwd, password_confirmation: pwd, self_created: true) - user.update_attribute(:remember_token, User.encrypt(remember_token)) + user.update_attribute(:remember_token, User.encrypt(remember_token)) administrator = User.create!(name: 'Pat the Administrator', email: 'administrator@example.com', password: pwd, password_confirmation: pwd, is_administrator: true, self_created: true) - Project.find(1).project_members.create!(creator: administrator, updater: administrator, user: user, is_project_administrator: true) + Project.find(1).project_members.create!(creator: administrator, updater: administrator, user:, is_project_administrator: true) set_user_project(user.id, 1) end - # We do this to handle the pre-request stubbing of objects in controllers. - # It mocks the behaviour of having accessed at least one page post login. + # We do this to handle the pre-request stubbing of objects in controllers. + # It mocks the behaviour of having accessed at least one page post login. def set_user_project(user_id, project_id) Current.user_id = user_id Current.project_id = project_id @@ -64,5 +64,3 @@ def sign_in_user end end - - From 1d5dc25ba8c2e6ba120e6eed36a2d8835f14402a Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 14:46:53 -0600 Subject: [PATCH 14/48] Move to kt-paperclip as a temporary step to ActiveStorage --- Gemfile | 8 ++++++-- Gemfile.lock | 26 +++++++------------------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/Gemfile b/Gemfile index 222e29e908..417ed929f0 100644 --- a/Gemfile +++ b/Gemfile @@ -78,8 +78,12 @@ gem 'paper_trail', '~> 15.0' gem 'acts_as_list', '~> 1.0' gem 'modularity', '~> 3.0.0' # TODO: Used!? -gem 'paperclip', github: 'LocoDelAssembly/paperclip', branch: 'migration-fix' # gem 'paperclip', '~> 6.1.0' -gem 'paperclip-meta', '~> 3.0' # TODO: kt-paperclip can be installed but because of this gem old paperclip is installed as well and deprecation warnings continue + +gem 'kt-paperclip', '~> 7.2' + +# gem 'paperclip', github: 'LocoDelAssembly/paperclip', branch: 'migration-fix' # gem 'paperclip', '~> 6.1.0' +# gem 'paperclip-meta', '~> 3.0' # TODO: kt-paperclip can be installed but because of this gem old paperclip is installed as well and deprecation warnings continue + gem 'voight_kampff', github: 'LocoDelAssembly/Voight-Kampff' gem 'shortener', '~> 1.0.0' gem 'rails_or', '~> 1.1.8' diff --git a/Gemfile.lock b/Gemfile.lock index be8aa5918e..a171415e6e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -31,18 +31,6 @@ GIT nokogiri (~> 1.7) rake -GIT - remote: https://github.com/LocoDelAssembly/paperclip.git - revision: 3840d5a63b1a85fb99bfc7c569d132af12a077a1 - branch: migration-fix - specs: - paperclip (6.1.0) - activemodel (>= 4.2.0) - activesupport (>= 4.2.0) - mime-types - mimemagic (~> 0.3.0) - terrapin (~> 0.6.0) - GIT remote: https://github.com/LocoDelAssembly/serrano.git revision: 6b5ce4abb016b628eae881437caf7d6a4e4de089 @@ -338,6 +326,12 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) + kt-paperclip (7.2.2) + activemodel (>= 4.2.0) + activesupport (>= 4.2.0) + marcel (~> 1.0.1) + mime-types + terrapin (>= 0.6.0, < 2.0) language_server-protocol (3.17.0.3) latex-decode (0.4.0) link_header (0.0.8) @@ -363,9 +357,6 @@ GEM mime-types (3.5.2) mime-types-data (~> 3.2015) mime-types-data (3.2024.0206) - mimemagic (0.3.10) - nokogiri (~> 1) - rake mini_mime (1.1.5) minitest (5.22.2) modularity (3.0.1) @@ -409,8 +400,6 @@ GEM paper_trail (15.1.0) activerecord (>= 6.1) request_store (~> 1.4) - paperclip-meta (3.1.0) - paperclip (>= 5.0) parallel (1.24.0) parallel_tests (4.5.0) parallel @@ -782,6 +771,7 @@ DEPENDENCIES jquery-turbolinks (~> 2.1) jquery-ui-rails! kaminari (~> 1.2.0) + kt-paperclip (~> 7.2) logic_tools logical_query_parser mail (~> 2.8, >= 2.8.1) @@ -791,8 +781,6 @@ DEPENDENCIES net-smtp (~> 0.3.1) os (~> 1.0, >= 1.0.1) paper_trail (~> 15.0) - paperclip! - paperclip-meta (~> 3.0) parallel (~> 1.23) parallel_tests passenger (~> 6.0.2) From 575914f1720c76992f4503e56b313eeeb4373362 Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 14:55:31 -0600 Subject: [PATCH 15/48] Use updated deprecator silence --- app/models/document.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/document.rb b/app/models/document.rb index e4ed96df73..b5930bfda5 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -57,8 +57,9 @@ class Document < ApplicationRecord accepts_nested_attributes_for :documentation, allow_destroy: true, reject_if: :reject_documentation + # TODO: Remove on ActiveStorage before_save :set_pdf_metadata, if: -> { - ActiveSupport::Deprecation.silence do + Rails.application.deprecators.silence do changed_attributes.include?('document_file_file_size') && document_file_content_type =~ /pdf/ end From a41a9906bc8f54ee64ca7db8a01e0b66f0f27f56 Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 15:22:24 -0600 Subject: [PATCH 16/48] rails active_stoarge:install migration --- ...te_active_storage_tables.active_storage.rb | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 db/migrate/20240212210249_create_active_storage_tables.active_storage.rb diff --git a/db/migrate/20240212210249_create_active_storage_tables.active_storage.rb b/db/migrate/20240212210249_create_active_storage_tables.active_storage.rb new file mode 100644 index 0000000000..e4706aa21c --- /dev/null +++ b/db/migrate/20240212210249_create_active_storage_tables.active_storage.rb @@ -0,0 +1,57 @@ +# This migration comes from active_storage (originally 20170806125915) +class CreateActiveStorageTables < ActiveRecord::Migration[7.0] + def change + # Use Active Record's configured type for primary and foreign keys + primary_key_type, foreign_key_type = primary_and_foreign_key_types + + create_table :active_storage_blobs, id: primary_key_type do |t| + t.string :key, null: false + t.string :filename, null: false + t.string :content_type + t.text :metadata + t.string :service_name, null: false + t.bigint :byte_size, null: false + t.string :checksum + + if connection.supports_datetime_with_precision? + t.datetime :created_at, precision: 6, null: false + else + t.datetime :created_at, null: false + end + + t.index [ :key ], unique: true + end + + create_table :active_storage_attachments, id: primary_key_type do |t| + t.string :name, null: false + t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type + t.references :blob, null: false, type: foreign_key_type + + if connection.supports_datetime_with_precision? + t.datetime :created_at, precision: 6, null: false + else + t.datetime :created_at, null: false + end + + t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true + t.foreign_key :active_storage_blobs, column: :blob_id + end + + create_table :active_storage_variant_records, id: primary_key_type do |t| + t.belongs_to :blob, null: false, index: false, type: foreign_key_type + t.string :variation_digest, null: false + + t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true + t.foreign_key :active_storage_blobs, column: :blob_id + end + end + + private + def primary_and_foreign_key_types + config = Rails.configuration.generators + setting = config.options[config.orm][:primary_key_type] + primary_key_type = setting || :primary_key + foreign_key_type = setting || :bigint + [primary_key_type, foreign_key_type] + end +end From 6b735e0e4679da89dc0c71857d3afe0a1a3b55a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Lucas=20Pereira?= Date: Mon, 12 Feb 2024 19:34:41 -0300 Subject: [PATCH 17/48] Fixed zeitwerk compliance spec failure --- app/controllers/api/v1/cite_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/api/v1/cite_controller.rb b/app/controllers/api/v1/cite_controller.rb index 49de662af9..a2c153b6c3 100644 --- a/app/controllers/api/v1/cite_controller.rb +++ b/app/controllers/api/v1/cite_controller.rb @@ -1,4 +1,3 @@ -require 'taxon_names_helper.rb' class Api::V1::CiteController < ApiController def count_valid_species From 38fc1e2a32d194f8f2d8c344cfd00319122d57fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Lucas=20Pereira?= Date: Mon, 12 Feb 2024 20:30:55 -0300 Subject: [PATCH 18/48] Several DwC-A importer compatibility fixes --- app/controllers/dataset_records_controller.rb | 2 +- app/models/dataset_record/darwin_core/taxon.rb | 16 ++++++++-------- app/models/dataset_record_field.rb | 4 ++-- app/models/import_dataset/darwin_core.rb | 2 +- .../import_dataset/darwin_core/occurrences.rb | 10 +++++----- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/controllers/dataset_records_controller.rb b/app/controllers/dataset_records_controller.rb index f28a347140..907279458c 100644 --- a/app/controllers/dataset_records_controller.rb +++ b/app/controllers/dataset_records_controller.rb @@ -110,7 +110,7 @@ def filtered_records dataset_records = import_dataset.core_records params[:filter]&.each do |key, value| dataset_records = dataset_records.where( - id: import_dataset.core_records_fields.at(key.to_i).with_value(value).select(:dataset_record_id) + id: import_dataset.core_records_fields.at(key.to_i).having_value(value).select(:dataset_record_id) ) end diff --git a/app/models/dataset_record/darwin_core/taxon.rb b/app/models/dataset_record/darwin_core/taxon.rb index 2ef25c4422..db48515c84 100644 --- a/app/models/dataset_record/darwin_core/taxon.rb +++ b/app/models/dataset_record/darwin_core/taxon.rb @@ -155,6 +155,7 @@ def import(dwc_data_attributes = {}) metadata: metadata }) + taxon_name.save! end # make OC relationships to OC ancestors @@ -205,7 +206,6 @@ def import(dwc_data_attributes = {}) !taxon_name.year_integer.nil? && ancestor_protonym.year_integer > taxon_name.year_integer - taxon_name.save! TaxonNameRelationship.find_or_create_by!(type: rank_in_type, subject_taxon_name: ancestor_protonym, object_taxon_name: taxon_name) end end @@ -223,7 +223,7 @@ def import(dwc_data_attributes = {}) # get OC dataset_record_id so we can pull the taxonRank from it. oc_dataset_record_id = import_dataset.core_records_fields .at(get_field_mapping(:taxonID)) - .with_value(get_field_value(:originalNameUsageID)) + .having_value(get_field_value(:originalNameUsageID)) .pick(:dataset_record_id) oc_protonym_rank = import_dataset.core_records_fields @@ -579,7 +579,7 @@ def create_parent_element_hash def get_parent DatasetRecord::DarwinCore::Taxon.where(id: import_dataset.core_records_fields .at(get_field_mapping(:taxonID)) - .with_value(get_field_value(:parentNameUsageID)) + .having_value(get_field_value(:parentNameUsageID)) .select(:dataset_record_id) ).first end @@ -588,7 +588,7 @@ def get_parent def get_original_combination DatasetRecord::DarwinCore::Taxon.where(id: import_dataset.core_records_fields .at(get_field_mapping(:taxonID)) - .with_value(get_field_value(:originalNameUsageID)) + .having_value(get_field_value(:originalNameUsageID)) .select(:dataset_record_id) ).first end @@ -597,7 +597,7 @@ def get_original_combination def find_by_taxonID(taxon_id) DatasetRecord::DarwinCore::Taxon.where(id: import_dataset.core_records_fields .at(get_field_mapping(:taxonID)) - .with_value(taxon_id.to_s) + .having_value(taxon_id.to_s) .select(:dataset_record_id) ).first end @@ -606,7 +606,7 @@ def find_by_taxonID(taxon_id) def get_taxon_name_from_taxon_id(taxon_id) TaxonName.find(DatasetRecord::DarwinCore::Taxon.where(id: import_dataset.core_records_fields .at(get_field_mapping(:taxonID)) - .with_value(taxon_id.to_s) + .having_value(taxon_id.to_s) .select(:dataset_record_id) ).pick(:metadata)['imported_objects']['taxon_name']['id']) end @@ -615,13 +615,13 @@ def get_taxon_name_from_taxon_id(taxon_id) def dependencies_imported?(taxon_id) dependency_taxon_ids = DatasetRecord::DarwinCore::Taxon.where(id: import_dataset.core_records_fields .at(get_field_mapping(:taxonID)) - .with_value(taxon_id.to_s) + .having_value(taxon_id.to_s) .select(:dataset_record_id) ).pick(:metadata)['dependencies'] DatasetRecord::DarwinCore::Taxon.where(id: import_dataset.core_records_fields .at(get_field_mapping(:taxonID)) - .with_values(dependency_taxon_ids.map { |d| d.to_s }) + .having_values(dependency_taxon_ids.map { |d| d.to_s }) .select(:dataset_record_id) ).where(status: 'Imported').count == dependency_taxon_ids.length diff --git a/app/models/dataset_record_field.rb b/app/models/dataset_record_field.rb index bece2bb41d..0886c1a7f5 100644 --- a/app/models/dataset_record_field.rb +++ b/app/models/dataset_record_field.rb @@ -20,13 +20,13 @@ def self.at(position) where(position: position) end - def self.with_value(value) + def self.having_value(value) where(indexed_column_value(value).eq(value)) end # Messy way of passing array of values for indexed_column_value # @param [Array] values - def self.with_values(values) + def self.having_values(values) if values.all? { |value| !value.nil? && value.length < VALUE_INDEX_LIMIT} where(indexed_column_value(values.first).in(values)) else diff --git a/app/models/import_dataset/darwin_core.rb b/app/models/import_dataset/darwin_core.rb index fb936d39e4..0da523d84a 100644 --- a/app/models/import_dataset/darwin_core.rb +++ b/app/models/import_dataset/darwin_core.rb @@ -329,7 +329,7 @@ def destroy_namespace def add_filters(records, filters) filters&.each do |key, value| - records = records.where(id: core_records_fields.at(key.to_i).with_value(value).select(:dataset_record_id)) + records = records.where(id: core_records_fields.at(key.to_i).having_value(value).select(:dataset_record_id)) end records end diff --git a/app/models/import_dataset/darwin_core/occurrences.rb b/app/models/import_dataset/darwin_core/occurrences.rb index 069f0b43dd..f4134dd20f 100644 --- a/app/models/import_dataset/darwin_core/occurrences.rb +++ b/app/models/import_dataset/darwin_core/occurrences.rb @@ -145,7 +145,7 @@ def update_catalog_number_namespace(institution_code, collection_code, namespace # TODO: Add scopes/methods in DatasetRecord to handle nil fields values transparently unless institution_code.nil? query = query.where( - id: core_records_fields.at(get_field_mapping(:institutionCode)).with_value(institution_code).select(:dataset_record_id) + id: core_records_fields.at(get_field_mapping(:institutionCode)).having_value(institution_code).select(:dataset_record_id) ) else query = query.where.not( @@ -154,7 +154,7 @@ def update_catalog_number_namespace(institution_code, collection_code, namespace end unless collection_code.nil? query = query.where( - id: core_records_fields.at(get_field_mapping(:collectionCode)).with_value(collection_code).select(:dataset_record_id) + id: core_records_fields.at(get_field_mapping(:collectionCode)).having_value(collection_code).select(:dataset_record_id) ) else query = query.where.not( @@ -182,16 +182,16 @@ def update_catalog_number_collection_code_namespace(collection_code, namespace_i if ready query.where( - id: core_records_fields.at(get_field_mapping(:collectionCode)).with_value(collection_code).select(:dataset_record_id) + id: core_records_fields.at(get_field_mapping(:collectionCode)).having_value(collection_code).select(:dataset_record_id) ).update_all( "status = 'Ready', metadata = metadata - 'error_data'" ) else institution_codes = self.metadata["catalog_numbers_namespaces"]&.select { |m| m[0][1] == collection_code && m[1] }&.map { |m| m[0][0] } || [] query.where( - id: core_records_fields.at(get_field_mapping(:collectionCode)).with_value(collection_code).select(:dataset_record_id) + id: core_records_fields.at(get_field_mapping(:collectionCode)).having_value(collection_code).select(:dataset_record_id) ).where.not( - id: core_records_fields.at(get_field_mapping(:institutionCode)).with_values(institution_codes).select(:dataset_record_id) + id: core_records_fields.at(get_field_mapping(:institutionCode)).having_values(institution_codes).select(:dataset_record_id) ).update_all( "status = 'NotReady', metadata = jsonb_set(metadata, '{error_data}', '{ \"messages\": { \"catalogNumber\": [\"Record cannot be imported until namespace is set, see \\\"Settings\\\".\"] } }')" ) From b55190c72ad550c00e937eba90d747e09e60c76d Mon Sep 17 00:00:00 2001 From: mjy Date: Mon, 12 Feb 2024 22:04:15 -0600 Subject: [PATCH 19/48] Update sprockets gem to latest --- Gemfile | 4 ++-- Gemfile.lock | 14 +++++++------- app/assets/config/manifest.js | 3 +++ 3 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 app/assets/config/manifest.js diff --git a/Gemfile b/Gemfile index 417ed929f0..e1dc3e9a40 100644 --- a/Gemfile +++ b/Gemfile @@ -89,8 +89,8 @@ gem 'shortener', '~> 1.0.0' gem 'rails_or', '~> 1.1.8' # javascript -gem 'sprockets-rails', '~> 3.2.0' # UPDATE TODO -gem 'sprockets', '~> 3.7.2' # TODO: Cannot use '~> 4.0' (app fails to initialize properly) +gem 'sprockets-rails', '~> 3.4.0' # UPDATE TODO +gem 'sprockets', '~> 4.2' # TODO: Cannot use '~> 4.0' (app fails to initialize properly) gem 'sprockets-es6', '~> 0.9.2', require: 'sprockets/es6' gem 'uglifier', '~> 4.2' diff --git a/Gemfile.lock b/Gemfile.lock index a171415e6e..6e09a6caec 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -637,16 +637,16 @@ GEM spring (4.1.3) spring-commands-rspec (1.0.4) spring (>= 0.9.1) - sprockets (3.7.2) + sprockets (4.2.1) concurrent-ruby (~> 1.0) - rack (> 1, < 3) + rack (>= 2.2.4, < 4) sprockets-es6 (0.9.2) babel-source (>= 5.8.11) babel-transpiler sprockets (>= 3.0.0) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) sqed (0.8.2) rake (~> 13.0) @@ -831,9 +831,9 @@ DEPENDENCIES shortener (~> 1.0.0) simplecov spring-commands-rspec (~> 1.0.4) - sprockets (~> 3.7.2) + sprockets (~> 4.2) sprockets-es6 (~> 0.9.2) - sprockets-rails (~> 3.2.0) + sprockets-rails (~> 3.4.0) sqed (~> 0.8.1) taxonifi (~> 0.6.0) term-ansicolor (~> 1.6) diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 0000000000..b16e53d6d5 --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,3 @@ +//= link_tree ../images +//= link_directory ../javascripts .js +//= link_directory ../stylesheets .css From 11b66c84b2a342bc98f96e3538f65a26ad8d31ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Lucas=20Pereira?= Date: Tue, 13 Feb 2024 12:48:39 -0300 Subject: [PATCH 20/48] rake secret -> rails secret --- Dockerfile | 2 +- k8s/dev/tw-secrets.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 38ae401446..de50b7de84 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,7 +59,7 @@ FROM base AS assets-precompiler # http://blog.zeit.io/use-a-fake-db-adapter-to-play-nice-with-rails-assets-precompilation/ RUN bundle add activerecord-nulldb-adapter RUN printf "production:\n adapter: nulldb" > config/database.yml \ -&& printf "production:\n secret_key_base: $(bundle exec rake secret)" > config/secrets.yml +&& printf "production:\n secret_key_base: $(bundle exec rails secret)" > config/secrets.yml # Precompiling and also removing config files just in case someone uses `docker build --target=assets-precompiler` diff --git a/k8s/dev/tw-secrets.yml b/k8s/dev/tw-secrets.yml index 859ce1bad2..665d4ba283 100644 --- a/k8s/dev/tw-secrets.yml +++ b/k8s/dev/tw-secrets.yml @@ -9,5 +9,5 @@ data: # echo -n foo | base64 db.root.password: dGF4b253b3Jrcw== # taxonworks db.user: dGF4b253b3Jrc19wcm9kdWN0aW9u # taxonworks_production db.user.password: dGF4b253b3Jrcw== # taxonworks - secret_key_base: cGFzc3dvcmQ= # password (replace with `rake secret`) + secret_key_base: cGFzc3dvcmQ= # password (replace with `rails secret`) nginx.secret: bmdpbnhfc2VjcmV0 # nginx_secret From ade928136bc8d65c4bb6fda07577c13919ca55d1 Mon Sep 17 00:00:00 2001 From: mjy Date: Tue, 13 Feb 2024 11:41:17 -0600 Subject: [PATCH 21/48] Replace deprecated methods Use check_all_pending! and alias_method --- app/models/concerns/shared/polymorphic_annotator.rb | 2 +- spec/rails_helper.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/concerns/shared/polymorphic_annotator.rb b/app/models/concerns/shared/polymorphic_annotator.rb index 0e9d11ebd1..58de4d3200 100644 --- a/app/models/concerns/shared/polymorphic_annotator.rb +++ b/app/models/concerns/shared/polymorphic_annotator.rb @@ -64,7 +64,7 @@ def self.polymorphic_annotates(polymorphic_belongs, foreign_key: nil, inverse_of belongs_to(polymorphic_belongs.to_sym, polymorphic: true, foreign_key: (foreign_key.nil? ? (polymorphic_belongs.to_s + '_id').to_s : polymorphic_belongs.to_s), inverse_of:) - alias_attribute :annotated_object, polymorphic_belongs.to_sym + alias_method :annotated_object, polymorphic_belongs.to_sym define_singleton_method(:annotator_reflection){polymorphic_belongs.to_s} diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 1e10598da8..d0bb5d7007 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -11,7 +11,7 @@ require_relative '../config/environment' -ActiveRecord::Migration.check_pending! +ActiveRecord::Migration.check_all_pending! ActiveRecord::Migration.maintain_test_schema! require 'amazing_print' @@ -29,4 +29,3 @@ ApplicationRecord.connection.tables.each { |t| ApplicationRecord.connection.reset_pk_sequence!(t) } FactoryBot.use_parent_strategy = false - From 7e5ccca79df93fd7d5a214917dce8fff8195a3e8 Mon Sep 17 00:00:00 2001 From: mjy Date: Tue, 13 Feb 2024 12:57:13 -0600 Subject: [PATCH 22/48] Remove @ from taxon name specs --- spec/models/taxon_name_spec.rb | 247 ++++++++++++++++----------------- 1 file changed, 118 insertions(+), 129 deletions(-) diff --git a/spec/models/taxon_name_spec.rb b/spec/models/taxon_name_spec.rb index 11a3a1ce86..7716cddcfa 100644 --- a/spec/models/taxon_name_spec.rb +++ b/spec/models/taxon_name_spec.rb @@ -6,27 +6,17 @@ let(:taxon_name) { TaxonName.new } context 'using before :all' do - before(:all) do - @subspecies = FactoryBot.create(:iczn_subspecies) - @species = @subspecies.ancestor_at_rank('species') - @subgenus = @subspecies.ancestor_at_rank('subgenus') - @genus = @subspecies.ancestor_at_rank('genus') - @tribe = @subspecies.ancestor_at_rank('tribe') - @family = @subspecies.ancestor_at_rank('family') - @root = @subspecies.root - end - - after(:all) do - TaxonNameRelationship.delete_all - TaxonName.delete_all - Citation.delete_all - Source.destroy_all - TaxonNameHierarchy.delete_all - end + let(:subspecies) { FactoryBot.create(:iczn_subspecies) } + let(:species) { subspecies.ancestor_at_rank('species') } + let(:subgenus) { subspecies.ancestor_at_rank('subgenus') } + let(:genus) { subspecies.ancestor_at_rank('genus') } + let(:tribe) { subspecies.ancestor_at_rank('tribe') } + let(:family) { subspecies.ancestor_at_rank('family') } + let(:root) { subspecies.root } specify '#name without space' do - s1 = FactoryBot.build(:relationship_species, name: 'with space', parent: @genus) + s1 = FactoryBot.build(:relationship_species, name: 'with space', parent: genus) s1.valid? expect(s1.errors[:name]).to_not be_empty end @@ -67,8 +57,8 @@ # TODO: this all needs to go context 'lint checking FactoryBot' do specify 'is building all related names for respective models' do - expect(@subspecies.ancestors.length).to be >= 10 - (@subspecies.ancestors + [@subspecies]).each do |i| + expect(subspecies.ancestors.length).to be >= 10 + (subspecies.ancestors + [subspecies]).each do |i| if i.name != 'Root' expect(i.valid?).to be_truthy, "#{i.name} is not valid [#{i.errors.messages}], and is expected to be so- was your test db reset properly?" end @@ -84,7 +74,7 @@ end end - expect(variety.root.id).to eq(@species.root.id) + expect(variety.root.id).to eq(species.root.id) expect(variety.cached_author_year).to eq('McAtee') expect(variety.cached_html).to eq('Aus (Aus) aaa bbb var. ccc') @@ -102,12 +92,12 @@ end specify '#descendants_of' do - expect(TaxonName.descendants_of(@genus).to_a).to contain_exactly(@subgenus, @species, @subspecies) + expect(TaxonName.descendants_of(genus).to_a).to contain_exactly(subgenus, species, subspecies) end context '#ancestors_and_descendants_of' do specify 'returns an unordered list' do - expect(TaxonName.ancestors_and_descendants_of(@genus).to_a.map(&:name)).to contain_exactly( + expect(TaxonName.ancestors_and_descendants_of(genus).to_a.map(&:name)).to contain_exactly( 'Animalia', 'Arthropoda', 'Cicadellidae', 'Erythroneura', 'Erythroneura', 'Erythroneurina', 'Erythroneurini', 'Hemiptera', 'Insecta', 'Root', 'Typhlocybinae', 'vitata', 'vitis' ) @@ -118,19 +108,19 @@ context 'rank related' do context '#ancestor_at_rank' do specify 'returns an ancestor at given rank' do - expect(@genus.ancestor_at_rank('family').name).to eq('Cicadellidae') + expect(genus.ancestor_at_rank('family').name).to eq('Cicadellidae') end specify "returns nil when given rank and name's rank are the same" do - expect(@genus.ancestor_at_rank('genus')).to be_nil + expect(genus.ancestor_at_rank('genus')).to be_nil end specify "returns nil when given rank is lower than name's rank" do - expect(@genus.ancestor_at_rank('species')).to be_nil + expect(genus.ancestor_at_rank('species')).to be_nil end specify 'returns nil when given rank is not present in the parent chain' do - expect(@genus.ancestor_at_rank('epifamily')).to be_nil + expect(genus.ancestor_at_rank('epifamily')).to be_nil end end end @@ -160,22 +150,22 @@ context 'name' do context 'validate cached values' do specify 'ICZN #cached_author_year' do - expect(@subspecies.reload.cached_author_year).to eq('McAtee, 1900') + expect(subspecies.reload.cached_author_year).to eq('McAtee, 1900') end specify 'ICZN #cached_html' do - expect(@subspecies.cached_html).to eq('Erythroneura (Erythroneura) vitis vitata') + expect(subspecies.cached_html).to eq('Erythroneura (Erythroneura) vitis vitata') end specify 'ICZN species misspelling' do - sp = FactoryBot.create(:iczn_species, verbatim_author: 'Smith', year_of_publication: 2000, parent: @genus) - sp.iczn_set_as_misapplication_of = @species + sp = FactoryBot.create(:iczn_species, verbatim_author: 'Smith', year_of_publication: 2000, parent: genus) + sp.iczn_set_as_misapplication_of = species expect(sp.save).to be_truthy expect(sp.cached_author_year).to eq('Smith, 2000 non McAtee, 1830') end specify 'ICZN combination' do - g1 = FactoryBot.create(:relationship_genus, parent: @family, name: 'Aus') + g1 = FactoryBot.create(:relationship_genus, parent: family, name: 'Aus') s = FactoryBot.create(:relationship_species, parent: g1, name: 'aus', year_of_publication: 1900, verbatim_author: 'McAtee') s.save! # WHY!? c1 = Combination.create!(genus: g1, species: s) @@ -183,8 +173,8 @@ end specify 'ICZN combination different genus' do - g1 = FactoryBot.create(:relationship_genus, parent: @family, name: 'Aus') - g2 = FactoryBot.create(:relationship_genus, parent: @family, name: 'Bus') + g1 = FactoryBot.create(:relationship_genus, parent: family, name: 'Aus') + g2 = FactoryBot.create(:relationship_genus, parent: family, name: 'Bus') s = FactoryBot.create(:relationship_species, parent: g1, name: 'aus', year_of_publication: 1900, verbatim_author: 'McAtee') s.original_genus = g2 s.save! @@ -196,23 +186,23 @@ context 'ICZN family (behaviour for names above genus group)' do specify 'cached_author_year' do - expect(@family.cached_author_year).to eq('Say, 1800') + expect(family.cached_author_year).to eq('Say, 1800') end specify 'cached_author_year with parentheses' do - sp = FactoryBot.create(:relationship_species, parent: @genus, year_of_publication: 2000, verbatim_author: '(Dmitriev)') + sp = FactoryBot.create(:relationship_species, parent: genus, year_of_publication: 2000, verbatim_author: '(Dmitriev)') expect(sp.cached_author_year).to eq('(Dmitriev, 2000)') end specify 'original combination' do - sp = FactoryBot.create(:relationship_species, name: 'albonigra', verbatim_name: 'albo-nigra', parent: @genus) - sp.update(original_genus: @genus) + sp = FactoryBot.create(:relationship_species, name: 'albonigra', verbatim_name: 'albo-nigra', parent: genus) + sp.update(original_genus: genus) expect(sp.cached_html).to eq('Erythroneura albonigra') end end specify 'nil author and year - cached value should be empty' do - t = @subspecies.ancestor_at_rank('kingdom') + t = subspecies.ancestor_at_rank('kingdom') expect(t.cached_author_year).to eq(nil) end @@ -227,7 +217,7 @@ end specify 'no original combination relationships' do - ssp = FactoryBot.build(:iczn_subspecies, parent: @species) + ssp = FactoryBot.build(:iczn_subspecies, parent: species) expect(ssp.get_genus_species(:original, :self).nil?).to be_truthy expect(ssp.get_genus_species(:original, :alternative).nil?).to be_truthy # expect(ssp.get_genus_species(:current, :self).nil?).to be_falsey @@ -243,107 +233,106 @@ specify 'misspelled original combination' do g = FactoryBot.create(:relationship_genus, name: 'Errorneura') - g.iczn_set_as_misspelling_of = @genus + g.iczn_set_as_misspelling_of = genus expect(g.save).to be_truthy - @subspecies.original_genus = g # ! not saved originally !! - @subspecies.reload + subspecies.original_genus = g # ! not saved originally !! + subspecies.reload expect(g.reload.get_full_name_html).to eq('Errorneura [sic]') - expect(@subspecies.get_original_combination).to eq('Errorneura [sic] [SPECIES NOT SPECIFIED] vitata') - expect(@subspecies.get_original_combination_html).to eq('Errorneura [sic] [SPECIES NOT SPECIFIED] vitata') - expect(@subspecies.get_author_and_year).to eq ('McAtee, 1900') + expect(subspecies.get_original_combination).to eq('Errorneura [sic] [SPECIES NOT SPECIFIED] vitata') + expect(subspecies.get_original_combination_html).to eq('Errorneura [sic] [SPECIES NOT SPECIFIED] vitata') + expect(subspecies.get_author_and_year).to eq ('McAtee, 1900') end # What code is this supposed to catch? specify 'moving nominotypical taxon' do - sp = FactoryBot.create(:iczn_species, name: 'aaa', parent: @genus) + sp = FactoryBot.create(:iczn_species, name: 'aaa', parent: genus) subsp = FactoryBot.create(:iczn_subspecies, name: 'aaa', parent: sp) - subsp.parent = @species + subsp.parent = species subsp.valid? expect(subsp.errors.include?(:parent_id)).to be_truthy end context 'cached homonyms' do - before(:each) do - @g1 = FactoryBot.create(:relationship_genus, name: 'Aus', parent: @tribe, year_of_publication: 1999) - @g2 = FactoryBot.create(:relationship_genus, name: 'Bus', parent: @tribe, year_of_publication: 2000) - @s1 = FactoryBot.create(:relationship_species, name: 'vitatus', parent: @g1, year_of_publication: 1999) - @s2 = FactoryBot.create(:relationship_species, name: 'vitatta', parent: @g2, year_of_publication: 2000) - expect(@family.valid?).to be_truthy - expect(@tribe.valid?).to be_truthy - expect(@g1.valid?).to be_truthy - expect(@g2.valid?).to be_truthy - expect(@s1.valid?).to be_truthy - expect(@s2.valid?).to be_truthy + let!(:g1) { FactoryBot.create(:relationship_genus, name: 'Aus', parent: tribe, year_of_publication: 1999) } + let!(:g2) { FactoryBot.create(:relationship_genus, name: 'Bus', parent: tribe, year_of_publication: 2000) } + let!(:s1) { FactoryBot.create(:relationship_species, name: 'vitatus', parent: g1, year_of_publication: 1999) } + let!(:s2) { FactoryBot.create(:relationship_species, name: 'vitatta', parent: g2, year_of_publication: 2000) } + + specify 'validity' do + expect(family.valid?).to be_truthy + expect(tribe.valid?).to be_truthy + expect(g1.valid?).to be_truthy + expect(g2.valid?).to be_truthy + expect(s1.valid?).to be_truthy + expect(s2.valid?).to be_truthy end specify 'primary homonym' do - expect(@family.cached_primary_homonym).to eq('Cicadellidae') - expect(@tribe.cached_primary_homonym).to eq('Erythroneurini') - expect(@tribe.cached_primary_homonym_alternative_spelling).to eq('Erythroneuridae') - expect(@g1.cached_primary_homonym).to eq('Aus') - expect(@g2.cached_primary_homonym).to eq('Bus') - expect(@s1.cached_primary_homonym.blank?).to be_truthy - expect(@s2.cached_primary_homonym.blank?).to be_truthy + expect(family.cached_primary_homonym).to eq('Cicadellidae') + expect(tribe.cached_primary_homonym).to eq('Erythroneurini') + expect(tribe.cached_primary_homonym_alternative_spelling).to eq('Erythroneuridae') + expect(g1.cached_primary_homonym).to eq('Aus') + expect(g2.cached_primary_homonym).to eq('Bus') + expect(s1.cached_primary_homonym.blank?).to be_truthy + expect(s2.cached_primary_homonym.blank?).to be_truthy end specify 'secondary homonym' do - expect(@family.cached_secondary_homonym.blank?).to be_truthy - expect(@g1.cached_secondary_homonym.blank?).to be_truthy - expect(@g2.cached_secondary_homonym.blank?).to be_truthy - expect(@s1.save).to be_truthy - expect(@s1.cached_secondary_homonym).to eq('Aus vitatus') - expect(@s2.save).to be_truthy - expect(@s2.cached_secondary_homonym).to eq('Bus vitatta') + expect(family.cached_secondary_homonym.blank?).to be_truthy + expect(g1.cached_secondary_homonym.blank?).to be_truthy + expect(g2.cached_secondary_homonym.blank?).to be_truthy + expect(s1.save).to be_truthy + expect(s1.cached_secondary_homonym).to eq('Aus vitatus') + expect(s2.save).to be_truthy + expect(s2.cached_secondary_homonym).to eq('Bus vitatta') end specify 'original genus' do - @s1.original_genus = @g1 - @s2.original_genus = @g1 - expect(@s1.save).to be_truthy - expect(@s2.save).to be_truthy - @s1.reload - @s2.reload - expect(@s1.cached_primary_homonym).to eq('Aus vitatus') - expect(@s2.cached_primary_homonym).to eq('Aus vitatta') - @s1.save - expect(@s1.cached_secondary_homonym).to eq('Aus vitatus') - @s2.save - expect(@s2.cached_secondary_homonym).to eq('Bus vitatta') - expect(@s1.cached_primary_homonym_alternative_spelling).to eq('Aus uitata') - expect(@s2.cached_primary_homonym_alternative_spelling).to eq('Aus uitata') - expect(@s1.cached_secondary_homonym_alternative_spelling).to eq('Aus uitata') - expect(@s2.cached_secondary_homonym_alternative_spelling).to eq('Bus uitata') + s1.original_genus = g1 + s2.original_genus = g1 + expect(s1.save).to be_truthy + expect(s2.save).to be_truthy + s1.reload + s2.reload + expect(s1.cached_primary_homonym).to eq('Aus vitatus') + expect(s2.cached_primary_homonym).to eq('Aus vitatta') + s1.save + expect(s1.cached_secondary_homonym).to eq('Aus vitatus') + s2.save + expect(s2.cached_secondary_homonym).to eq('Bus vitatta') + expect(s1.cached_primary_homonym_alternative_spelling).to eq('Aus uitata') + expect(s2.cached_primary_homonym_alternative_spelling).to eq('Aus uitata') + expect(s1.cached_secondary_homonym_alternative_spelling).to eq('Aus uitata') + expect(s2.cached_secondary_homonym_alternative_spelling).to eq('Bus uitata') end end context 'mismatching cached values' do - before(:all) do - @g = FactoryBot.create(:relationship_genus, name: 'Cus', parent: @family) - @s = FactoryBot.build(:relationship_species, name: 'dus', parent: @g) - end + let(:g) { FactoryBot.create(:relationship_genus, name: 'Cus', parent: family) } + let(:s) { FactoryBot.build(:relationship_species, name: 'dus', parent: g) } specify 'missing cached values' do - @s.save - @s.update_column(:cached_original_combination, 'aaa') - @s.soft_validate(only_sets: :cached_names) - expect(@s.soft_validations.messages_on(:base).count).to eq(1) - @s.fix_soft_validations - @s.soft_validate(only_sets: :cached_names) - expect(@s.soft_validations.messages_on(:base).empty?).to be_truthy + s.save + s.update_column(:cached_original_combination, 'aaa') + s.soft_validate(only_sets: :cached_names) + expect(s.soft_validations.messages_on(:base).count).to eq(1) + s.fix_soft_validations + s.soft_validate(only_sets: :cached_names) + expect(s.soft_validations.messages_on(:base).empty?).to be_truthy end end context 'valid_taxon_name' do context 'validity with/out classifications' do - let!(:valid_genus) { Protonym.create(name: 'Aus', rank_class: Ranks.lookup(:iczn, :genus), parent: @family) } - let!(:other_genus) { Protonym.create(name: 'Bus', rank_class: Ranks.lookup(:iczn, :genus), parent: @family) } + let!(:valid_genus) { Protonym.create(name: 'Aus', rank_class: Ranks.lookup(:iczn, :genus), parent: family) } + let!(:other_genus) { Protonym.create(name: 'Bus', rank_class: Ranks.lookup(:iczn, :genus), parent: family) } - before { - TaxonNameRelationship::Iczn::Invalidating::Synonym.create!(subject_taxon_name: valid_genus, object_taxon_name: other_genus) - } + before { + TaxonNameRelationship::Iczn::Invalidating::Synonym.create!(subject_taxon_name: valid_genus, object_taxon_name: other_genus) + } context 'without valid classification' do specify '#relationship_invalid?' do @@ -418,10 +407,10 @@ end specify 'get_valid_taxon_name' do - g1 = FactoryBot.create(:relationship_genus, name: 'Cus', parent: @family) - g2 = FactoryBot.create(:relationship_genus, name: 'Cus', parent: @family) - g3 = FactoryBot.create(:relationship_genus, name: 'Cus', parent: @family) - g4 = FactoryBot.create(:relationship_genus, name: 'Cus', parent: @family) + g1 = FactoryBot.create(:relationship_genus, name: 'Cus', parent: family) + g2 = FactoryBot.create(:relationship_genus, name: 'Cus', parent: family) + g3 = FactoryBot.create(:relationship_genus, name: 'Cus', parent: family) + g4 = FactoryBot.create(:relationship_genus, name: 'Cus', parent: family) s1 = FactoryBot.create(:valid_source_bibtex, title: 'article 1', year: 1900) s2 = FactoryBot.create(:valid_source_bibtex, title: 'article 2', year: 2000) expect(g1.get_valid_taxon_name).to eq(g1) @@ -448,15 +437,15 @@ end specify 'list of invalid taxon names, year priority' do - a = FactoryBot.create(:relationship_genus, name: 'Aus', parent: @family) - b = FactoryBot.create(:relationship_genus, name: 'Bus', parent: @family) - c = FactoryBot.create(:relationship_genus, name: 'Cus', parent: @family) - d = FactoryBot.create(:relationship_genus, name: 'Dus', parent: @family) - e = FactoryBot.create(:relationship_genus, name: 'Eus', parent: @family) - f = FactoryBot.create(:relationship_genus, name: 'Fus', parent: @family) - g = FactoryBot.create(:relationship_genus, name: 'Gus', parent: @family) - h = FactoryBot.create(:relationship_genus, name: 'Hus', parent: @family) - i = FactoryBot.create(:relationship_genus, name: 'Ius', parent: @family) + a = FactoryBot.create(:relationship_genus, name: 'Aus', parent: family) + b = FactoryBot.create(:relationship_genus, name: 'Bus', parent: family) + c = FactoryBot.create(:relationship_genus, name: 'Cus', parent: family) + d = FactoryBot.create(:relationship_genus, name: 'Dus', parent: family) + e = FactoryBot.create(:relationship_genus, name: 'Eus', parent: family) + f = FactoryBot.create(:relationship_genus, name: 'Fus', parent: family) + g = FactoryBot.create(:relationship_genus, name: 'Gus', parent: family) + h = FactoryBot.create(:relationship_genus, name: 'Hus', parent: family) + i = FactoryBot.create(:relationship_genus, name: 'Ius', parent: family) s1 = FactoryBot.create(:valid_source_bibtex, title: 'article 1', year: 1900) s2 = FactoryBot.create(:valid_source_bibtex, title: 'article 2', year: 1950) s3 = FactoryBot.create(:valid_source_bibtex, title: 'article 3', year: 1960) @@ -494,8 +483,8 @@ end context 'invalid taxon_names with reverse relationship' do - let!(:a) { FactoryBot.create(:relationship_genus, name: 'Aus', parent: @family) } - let!(:b) { FactoryBot.create(:relationship_genus, name: 'Bus', parent: @family) } + let!(:a) { FactoryBot.create(:relationship_genus, name: 'Aus', parent: family) } + let!(:b) { FactoryBot.create(:relationship_genus, name: 'Bus', parent: family) } let!(:s) { TaxonNameClassification::Iczn::Available::Valid.create(taxon_name: a) } let!(:r1) { TaxonNameRelationship::Iczn::Invalidating::Synonym.create(subject_taxon_name: a, object_taxon_name: b) } let!(:r2) { TaxonNameRelationship::Iczn::Invalidating::Synonym.create(subject_taxon_name: b, object_taxon_name: a) } @@ -517,10 +506,10 @@ context 'relationships' do specify 'invalid parent' do - g = FactoryBot.create(:iczn_genus, parent: @family) + g = FactoryBot.create(:iczn_genus, parent: family) s = FactoryBot.create(:iczn_species, parent: g) - r1 = FactoryBot.create(:taxon_name_relationship, subject_taxon_name: g, object_taxon_name: @genus, type: 'TaxonNameRelationship::Iczn::Invalidating::Synonym') + r1 = FactoryBot.create(:taxon_name_relationship, subject_taxon_name: g, object_taxon_name: genus, type: 'TaxonNameRelationship::Iczn::Invalidating::Synonym') c1 = FactoryBot.create(:taxon_name_classification, taxon_name: g, type: 'TaxonNameClassification::Iczn::Unavailable::NomenNudum') s.soft_validate(only_sets: :parent_is_valid_name) g.soft_validate(only_sets: :parent_is_valid_name) @@ -535,8 +524,8 @@ end specify 'conflicting synonyms: reverse relationships' do - a = FactoryBot.create(:relationship_genus, name: 'Aus', parent: @family) - b = FactoryBot.create(:relationship_genus, name: 'Bus', parent: @family) + a = FactoryBot.create(:relationship_genus, name: 'Aus', parent: family) + b = FactoryBot.create(:relationship_genus, name: 'Bus', parent: family) r1 = TaxonNameRelationship::Iczn::Invalidating::Synonym.create(subject_taxon_name: a, object_taxon_name: b) r2 = TaxonNameRelationship::Iczn::Invalidating::Synonym.create(subject_taxon_name: b, object_taxon_name: a) a.soft_validate(only_sets: :not_synonym_of_self) @@ -547,9 +536,9 @@ end specify 'conflicting synonyms: same nomenclatural priority' do - a = FactoryBot.create(:relationship_genus, name: 'Aus', parent: @family) - b = FactoryBot.create(:relationship_genus, name: 'Bus', parent: @family) - c = FactoryBot.create(:relationship_genus, name: 'Cus', parent: @family) + a = FactoryBot.create(:relationship_genus, name: 'Aus', parent: family) + b = FactoryBot.create(:relationship_genus, name: 'Bus', parent: family) + c = FactoryBot.create(:relationship_genus, name: 'Cus', parent: family) s1 = FactoryBot.create(:valid_source_bibtex, title: 'article 1', year: 1900) r1 = TaxonNameRelationship::Iczn::Invalidating::Synonym.create(subject_taxon_name: a, object_taxon_name: b) @@ -777,8 +766,8 @@ context 'instance tests' do let(:type_of_genus) { Protonym.create(name: 'Bus', rank_class: Ranks.lookup(:iczn, :genus), parent: root1) } let(:original_genus) { Protonym.create(name: 'Cus', rank_class: Ranks.lookup(:iczn, :genus), parent: root1) } - let!(:relationship1) { FactoryBot.create(:type_species_relationship, subject_taxon_name: species, object_taxon_name: type_of_genus) } # @taxon_name - let!(:relationship2) { TaxonNameRelationship::OriginalCombination::OriginalGenus.create!(subject_taxon_name: original_genus, object_taxon_name: species) } # @taxon_name + let!(:relationship1) { FactoryBot.create(:type_species_relationship, subject_taxon_name: species, object_taxon_name: type_of_genus) } + let!(:relationship2) { TaxonNameRelationship::OriginalCombination::OriginalGenus.create!(subject_taxon_name: original_genus, object_taxon_name: species) } # TaxonNameRelationships in which the taxon name is the subject specify '#taxon_name_relationships' do From 952b8a1394d061ad1453192aeaedfe7566bbc01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Lucas=20Pereira?= Date: Tue, 13 Feb 2024 16:35:58 -0300 Subject: [PATCH 23/48] Postgis extension no created by default anymore. --- db/migrate/20130101000000_postgis_extend.rb | 5 ++--- db/migrate/20140410190430_add_hstore_extension.rb | 8 ++------ .../20140701160736_add_extension_fuzzy_match_str.rb | 8 ++------ 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/db/migrate/20130101000000_postgis_extend.rb b/db/migrate/20130101000000_postgis_extend.rb index c7e31e5733..1f748152cc 100644 --- a/db/migrate/20130101000000_postgis_extend.rb +++ b/db/migrate/20130101000000_postgis_extend.rb @@ -1,7 +1,6 @@ class PostgisExtend < ActiveRecord::Migration[4.2] def change - # Deprecated. This is not needed when rake db:setup is used - # ActiveRecord::Base.connection.execute('CREATE EXTENSION postgis') - # ActiveRecord::Base.connection.execute('CREATE EXTENSION postgis_topology') + enable_extension 'postgis' + enable_extension 'postgis_topology' end end diff --git a/db/migrate/20140410190430_add_hstore_extension.rb b/db/migrate/20140410190430_add_hstore_extension.rb index eceec334ed..dbd718d8c2 100644 --- a/db/migrate/20140410190430_add_hstore_extension.rb +++ b/db/migrate/20140410190430_add_hstore_extension.rb @@ -1,9 +1,5 @@ class AddHstoreExtension < ActiveRecord::Migration[4.2] - def up - execute 'CREATE EXTENSION IF NOT EXISTS hstore' - end - - def down - execute 'DROP EXTENSION hstore' + def change + enable_extension 'hstore' end end diff --git a/db/migrate/20140701160736_add_extension_fuzzy_match_str.rb b/db/migrate/20140701160736_add_extension_fuzzy_match_str.rb index 9a078c7445..fb36942620 100644 --- a/db/migrate/20140701160736_add_extension_fuzzy_match_str.rb +++ b/db/migrate/20140701160736_add_extension_fuzzy_match_str.rb @@ -1,9 +1,5 @@ class AddExtensionFuzzyMatchStr < ActiveRecord::Migration[4.2] - def up - execute 'CREATE EXTENSION IF NOT EXISTS fuzzystrmatch' - end - - def down - execute 'DROP EXTENSION fuzzystrmatch' + def change + enable_extension 'fuzzystrmatch' end end From e6107a6411d331fa34ccd78a03b1dff08366de40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Lucas=20Pereira?= Date: Tue, 13 Feb 2024 16:43:40 -0300 Subject: [PATCH 24/48] Undo postgis_topology inclusion --- db/migrate/20130101000000_postgis_extend.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20130101000000_postgis_extend.rb b/db/migrate/20130101000000_postgis_extend.rb index 1f748152cc..e7dab45512 100644 --- a/db/migrate/20130101000000_postgis_extend.rb +++ b/db/migrate/20130101000000_postgis_extend.rb @@ -1,6 +1,6 @@ class PostgisExtend < ActiveRecord::Migration[4.2] def change enable_extension 'postgis' - enable_extension 'postgis_topology' + # enable_extension 'postgis_topology' # This extension is NOT used. end end From 08b45b26288d4f882b221e6971047153c0964c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Lucas=20Pereira?= Date: Tue, 13 Feb 2024 17:39:25 -0300 Subject: [PATCH 25/48] Replaced uglifier with terser --- Gemfile | 2 +- Gemfile.lock | 6 +++--- config/environments/production.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index e1dc3e9a40..ad2beb9bda 100644 --- a/Gemfile +++ b/Gemfile @@ -92,7 +92,7 @@ gem 'rails_or', '~> 1.1.8' gem 'sprockets-rails', '~> 3.4.0' # UPDATE TODO gem 'sprockets', '~> 4.2' # TODO: Cannot use '~> 4.0' (app fails to initialize properly) gem 'sprockets-es6', '~> 0.9.2', require: 'sprockets/es6' -gem 'uglifier', '~> 4.2' +gem 'terser', '~> 1.2' gem 'jquery-rails', '~> 4.4' # gem 'jquery-ui-rails', '~> 6.0.1' diff --git a/Gemfile.lock b/Gemfile.lock index 6e09a6caec..4b49548434 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -660,6 +660,8 @@ GEM tins (~> 1.0) terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) + terser (1.2.0) + execjs (>= 0.3.0, < 3) thor (1.2.2) tilt (2.3.0) timecop (0.9.8) @@ -677,8 +679,6 @@ GEM concurrent-ruby (~> 1.0) tzinfo-data (1.2024.1) tzinfo (>= 1.0.0) - uglifier (4.2.0) - execjs (>= 0.3.0, < 3) unicode-display_width (2.5.0) uri (0.13.0) validates_timeliness (7.0.0.beta2) @@ -837,11 +837,11 @@ DEPENDENCIES sqed (~> 0.8.1) taxonifi (~> 0.6.0) term-ansicolor (~> 1.6) + terser (~> 1.2) thor (~> 1.2) timecop (~> 0.9.1) turbolinks (~> 5.2.0) tzinfo-data (~> 1.2019) - uglifier (~> 4.2) validates_timeliness (~> 7.0.0.beta2) vcr (~> 6.0) voight_kampff! diff --git a/config/environments/production.rb b/config/environments/production.rb index 3a7258ad16..68bad4eca0 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -29,7 +29,7 @@ config.serve_static_files = false # true # was false until oct/2014 # Compress JavaScripts and CSS. - config.assets.js_compressor = Uglifier.new(harmony: true) + config.assets.js_compressor = :terser # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. From c7f6da15366acbf69f32df8acf7c58ddb5259a0d Mon Sep 17 00:00:00 2001 From: mjy Date: Tue, 13 Feb 2024 15:11:48 -0600 Subject: [PATCH 26/48] Handle freeze in cached role update. Remove require_dependencies --- app/models/role.rb | 49 +++++++++++++------------ spec/models/protonym/authorship_spec.rb | 22 +++++------ 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/app/models/role.rb b/app/models/role.rb index dd9864da5d..df89b81d54 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -130,7 +130,8 @@ def set_cached end def set_role_object_cached - becomes(type.constantize).cached_trigger_methods(role_object).each do |m| + a = self.dup + a.becomes(type.constantize).cached_trigger_methods(role_object).each do |m| role_object.send(m) unless role_object.destroyed? end end @@ -159,26 +160,26 @@ def cached_trigger_methods(object) # # Person only roles -require_dependency 'taxon_name_author' -require_dependency 'source_source' -require_dependency 'source_author' -require_dependency 'source_editor' -require_dependency 'collector' -require_dependency 'georeferencer' -require_dependency 'loan_recipient' -require_dependency 'loan_supervisor' - -# Records below have not been hooked to Person activity years - -require_dependency 'accession_provider' -require_dependency 'deaccession_recipient' -require_dependency 'verifier' - -# TODO: these are being used in Attribution, or not? -require_dependency 'attribution_creator' -require_dependency 'attribution_editor' - -# Person OR Organization roles -require_dependency 'attribution_copyright_holder' -require_dependency 'attribution_owner' -require_dependency 'determiner' +# require_dependency 'taxon_name_author' +# require_dependency 'source_source' +# require_dependency 'source_author' +# require_dependency 'source_editor' +# require_dependency 'collector' +# require_dependency 'georeferencer' +# require_dependency 'loan_recipient' +# require_dependency 'loan_supervisor' + +# # Records below have not been hooked to Person activity years + +# require_dependency 'accession_provider' +# require_dependency 'deaccession_recipient' +# require_dependency 'verifier' + +# # TODO: these are being used in Attribution, or not? +# require_dependency 'attribution_creator' +# require_dependency 'attribution_editor' + +# # Person OR Organization roles +# require_dependency 'attribution_copyright_holder' +# require_dependency 'attribution_owner' +# require_dependency 'determiner' diff --git a/spec/models/protonym/authorship_spec.rb b/spec/models/protonym/authorship_spec.rb index a72c7816d2..ebe4cd618a 100644 --- a/spec/models/protonym/authorship_spec.rb +++ b/spec/models/protonym/authorship_spec.rb @@ -19,9 +19,9 @@ context 'by nested attributes' do let(:name) { Protonym.create!( - name: 'aus', - parent: root, - rank_class: Ranks.lookup(:iczn, :species), + name: 'aus', + parent: root, + rank_class: Ranks.lookup(:iczn, :species), taxon_name_author_roles_attributes: [ {person_id: p1.id}, {person: p2}, @@ -35,22 +35,22 @@ context 'updating roles' do let(:name) { Protonym.create!( - name: 'aus', - parent: root, - rank_class: Ranks.lookup(:iczn, :species), + name: 'aus', + parent: root, + rank_class: Ranks.lookup(:iczn, :species), taxon_name_author_roles_attributes: [ {person_id: p1.id}])} let(:first_role_id) {name.taxon_name_author_roles.first.id } - + specify '#author_string 1' do name.update(taxon_name_author_roles_attributes: [{_destroy: true, id: first_role_id}, {person: p2}]) expect(name.author_string).to eq('Jones') end - specify '#author_string 2' do - name.update(roles_attributes: [{_destroy: true, id: first_role_id}, {type: 'TaxonNameAuthor', person: p2}]) - expect(name.author_string).to eq('Jones') - end + specify '#author_string 2' do + name.update(roles_attributes: [{_destroy: true, id: first_role_id}, {type: 'TaxonNameAuthor', person: p2}]) + expect(name.author_string).to eq('Jones') + end end end From 07495ffd5462d6845ef67ee73e580d3a06a96dfb Mon Sep 17 00:00:00 2001 From: mjy Date: Tue, 13 Feb 2024 16:04:00 -0600 Subject: [PATCH 27/48] Update Citation expectation. !! validates_uniqueness_of now compares "across the system", which apperently means unsaved objects in this case, this is very different behaviour (if interpretation is correct) that we may have to take into account in import scripts. --- app/models/citation.rb | 3 ++- app/models/concerns/shared/citations.rb | 2 +- spec/models/citation_spec.rb | 19 ++++++++++--------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/models/citation.rb b/app/models/citation.rb index b896e907ab..68d3e8cf75 100644 --- a/app/models/citation.rb +++ b/app/models/citation.rb @@ -49,8 +49,9 @@ class Citation < ApplicationRecord has_many :documents, through: :source validates_presence_of :source + validates_uniqueness_of :source_id, scope: [:citation_object_id, :citation_object_type, :pages] - validates_uniqueness_of :is_original, scope: [:citation_object_type, :citation_object_id], message: 'origin can only be assigned once', allow_nil: true, if: :is_original? + validates_uniqueness_of :is_original, scope: [:citation_object_type, :citation_object_id], message: 'origin can only be assigned once', allow_nil: true, if: -> { is_original? } accepts_nested_attributes_for :citation_topics, allow_destroy: true, reject_if: :reject_citation_topics accepts_nested_attributes_for :topics, allow_destroy: true, reject_if: :reject_topic diff --git a/app/models/concerns/shared/citations.rb b/app/models/concerns/shared/citations.rb index 438d72be25..07d3893572 100644 --- a/app/models/concerns/shared/citations.rb +++ b/app/models/concerns/shared/citations.rb @@ -100,7 +100,7 @@ module Shared::Citations accepts_nested_attributes_for :citations, reject_if: :reject_citations, allow_destroy: true accepts_nested_attributes_for :origin_citation, reject_if: :reject_citations, allow_destroy: true - validate :origin_citation_source_id, if: -> {!new_record?} + validate :origin_citation_source_id, if: -> { !new_record? } # !! use validate: true in associations settings to trigger this as needed # Required to trigger validate callbacks, which in turn set user_id related housekeeping diff --git a/spec/models/citation_spec.rb b/spec/models/citation_spec.rb index 78110362eb..11e260f7d8 100644 --- a/spec/models/citation_spec.rb +++ b/spec/models/citation_spec.rb @@ -7,11 +7,10 @@ let(:topic) { FactoryBot.create(:valid_topic) } let(:pdf) { Rack::Test::UploadedFile.new( Spec::Support::Utilities::Files.generate_pdf(pages: 10) ) } - specify '.batch_create 1' do o1 = FactoryBot.create(:valid_otu) o2 = FactoryBot.create(:valid_otu) - + s = FactoryBot.create(:valid_source) h = { @@ -23,9 +22,9 @@ p = ActionController::Parameters.new(h) p.permit! - + Citation.batch_create(p) - + expect(Citation.count).to eq(2) expect(Citation.first.pages).to eq('22') end @@ -156,16 +155,18 @@ let(:c3) { Citation.new() } specify 'one is_original per citation_object' do - c1.update(is_original: true) + c1.update!(is_original: true) c2.is_original = true expect(c2.valid?).to be_falsey expect(c2.errors[:is_original]).to be_truthy end - specify 'many is_original is false per citation_object' do - c1.update(is_original: false) - c2.is_original = false + specify 'many is_original is invalid per citation_object' do + c1.update!(is_original: false) expect(c1.valid?).to be_truthy + + # !! validates_uniqueness of now crosses into in-memory objects + c2.is_original = false expect(c2.errors[:is_original].empty?).to be_truthy end @@ -206,7 +207,7 @@ c3.citation_object = otu expect(c3.valid?).to be_falsey - expect(c3.errors.messages[:source]).to be_truthy + expect(c3.errors.messages[:source]).to be_truthy end end From 0d20589619b16e03b882a7de3f89932fc30763cc Mon Sep 17 00:00:00 2001 From: mjy Date: Tue, 13 Feb 2024 16:39:52 -0600 Subject: [PATCH 28/48] build_ is not saved on has_one when parent saved --- spec/models/concerns/shared/loanable_spec.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spec/models/concerns/shared/loanable_spec.rb b/spec/models/concerns/shared/loanable_spec.rb index 55d7bbf812..669215e002 100644 --- a/spec/models/concerns/shared/loanable_spec.rb +++ b/spec/models/concerns/shared/loanable_spec.rb @@ -98,10 +98,13 @@ specify 'setting loan_item sets loan' do class_with_loan.save! - class_with_loan.build_loan_item(loan:) - class_with_loan.save! - expect(class_with_loan.loan_item.id).to be_truthy + class_with_loan.create_loan_item(loan:) + + # No longer saves the build + # class_with_loan.save! + + expect(class_with_loan.reload_loan_item.id).to be_truthy end specify 'has_one loan' do From c3f13cae3553650985c802523b6141a3f3851185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Lucas=20Pereira?= Date: Tue, 13 Feb 2024 19:47:52 -0300 Subject: [PATCH 29/48] Replaced paperclip-meta with custom repo for kt-paperclip compatibility --- Gemfile | 2 +- Gemfile.lock | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index ad2beb9bda..9fd42ed027 100644 --- a/Gemfile +++ b/Gemfile @@ -82,7 +82,7 @@ gem 'modularity', '~> 3.0.0' # TODO: Used!? gem 'kt-paperclip', '~> 7.2' # gem 'paperclip', github: 'LocoDelAssembly/paperclip', branch: 'migration-fix' # gem 'paperclip', '~> 6.1.0' -# gem 'paperclip-meta', '~> 3.0' # TODO: kt-paperclip can be installed but because of this gem old paperclip is installed as well and deprecation warnings continue +gem 'paperclip-meta', github: 'LocoDelAssembly/paperclip-meta', branch: 'kt-paperclip' gem 'voight_kampff', github: 'LocoDelAssembly/Voight-Kampff' gem 'shortener', '~> 1.0.0' diff --git a/Gemfile.lock b/Gemfile.lock index 4b49548434..ac9e1ee8c5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -31,6 +31,14 @@ GIT nokogiri (~> 1.7) rake +GIT + remote: https://github.com/LocoDelAssembly/paperclip-meta.git + revision: 31c55c7d914d14460b8907a546bd66287cc22988 + branch: kt-paperclip + specs: + paperclip-meta (3.1.0) + kt-paperclip (>= 7.0) + GIT remote: https://github.com/LocoDelAssembly/serrano.git revision: 6b5ce4abb016b628eae881437caf7d6a4e4de089 @@ -781,6 +789,7 @@ DEPENDENCIES net-smtp (~> 0.3.1) os (~> 1.0, >= 1.0.1) paper_trail (~> 15.0) + paperclip-meta! parallel (~> 1.23) parallel_tests passenger (~> 6.0.2) From 50e432db3e179d34192507803ace1eda03ee6fa5 Mon Sep 17 00:00:00 2001 From: mjy Date: Tue, 13 Feb 2024 16:57:59 -0600 Subject: [PATCH 30/48] Use new "with()" to fix query join --- app/models/sqed_depiction.rb | 2 +- lib/queries/sqed_depiction/filter.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/sqed_depiction.rb b/app/models/sqed_depiction.rb index bc93cbe27d..73c2d71a7a 100644 --- a/app/models/sqed_depiction.rb +++ b/app/models/sqed_depiction.rb @@ -46,7 +46,7 @@ class SqedDepiction < ApplicationRecord belongs_to :depiction has_one :image, through: :depiction - has_one :collection_object, through: :depiction, source_type: 'CollectionObject', source: :depiction_object + has_one :collection_object, through: :depiction, source_type: 'CollectionObject', source: :depiction_object, inverse_of: :sqed_depictions validates_presence_of :depiction validates_presence_of :metadata_map, :boundary_color diff --git a/lib/queries/sqed_depiction/filter.rb b/lib/queries/sqed_depiction/filter.rb index d6633785ea..2326ee477a 100644 --- a/lib/queries/sqed_depiction/filter.rb +++ b/lib/queries/sqed_depiction/filter.rb @@ -49,10 +49,9 @@ def sqed_depiction_id [@sqed_depiction_id].flatten.compact end - # TODO: use WITH def base_collection_object_query_facet q = ::Queries::CollectionObject::Filter.new(base_collection_object_filter_params).all - ::SqedDepiction.joins(:collection_object).where(collection_objects: q) + ::SqedDepiction.joins(:collection_object).with(collection_objects: q) end def merge_clauses From 95d5345ee887b3631250d47eb1234015b1623b35 Mon Sep 17 00:00:00 2001 From: mjy Date: Wed, 14 Feb 2024 08:14:47 -0600 Subject: [PATCH 31/48] Update invalid params --- spec/controllers/pinboard_items_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/pinboard_items_controller_spec.rb b/spec/controllers/pinboard_items_controller_spec.rb index 31d8e06005..0990a96513 100644 --- a/spec/controllers/pinboard_items_controller_spec.rb +++ b/spec/controllers/pinboard_items_controller_spec.rb @@ -32,7 +32,7 @@ } let(:invalid_attributes) { - {pinned_object_type: 'Smurf'} + {pinned_object_type_id: nil} } # This should return the minimal set of values that should be in the session From cb1870857fac86b209c9f8a8c20732a24fdc097b Mon Sep 17 00:00:00 2001 From: mjy Date: Wed, 14 Feb 2024 08:21:50 -0600 Subject: [PATCH 32/48] Better after create behaviour updates the in-memory objects now --- spec/lib/batch_load/import/da_for_otus_spec.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/spec/lib/batch_load/import/da_for_otus_spec.rb b/spec/lib/batch_load/import/da_for_otus_spec.rb index bab0aa538d..ad82c70904 100644 --- a/spec/lib/batch_load/import/da_for_otus_spec.rb +++ b/spec/lib/batch_load/import/da_for_otus_spec.rb @@ -20,7 +20,7 @@ } let(:source) { FactoryBot.create(:valid_source_verbatim) } - + let(:upload_file_2) { Rack::Test::UploadedFile.new(file_ph_2) } let(:import_2_im) { BatchLoad::Import::Otus::DataAttributesInterpreter.new( @@ -56,7 +56,7 @@ file: upload_file_2, type_select: 'import' ) } - + let(:import_no_new_otus) { BatchLoad::Import::Otus::DataAttributesInterpreter.new( project_id:, user_id: user.id, @@ -358,10 +358,7 @@ end specify '#valid_objects' do - # The 5 data attributes are shown as invalid because - # their base object is not yet saved. - # See polymorphic_annotator.rb validate associated - expect(import_2_in.valid_objects.count).to eq(14) + expect(import_2_in.valid_objects.count).to eq(19) end specify '#successful_rows' do From 7a4c1ba2e29a738c3bef27c406a9277ec332799f Mon Sep 17 00:00:00 2001 From: mjy Date: Thu, 15 Feb 2024 12:17:30 -0600 Subject: [PATCH 33/48] Remove redundant :create_otu --- app/models/protonym.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/models/protonym.rb b/app/models/protonym.rb index 0df00ad284..41d7df3987 100644 --- a/app/models/protonym.rb +++ b/app/models/protonym.rb @@ -39,8 +39,6 @@ class Protonym < TaxonName :verbatim_author_without_digits, :verbatim_author_with_closed_parens_when_present - after_create :create_otu, if: -> {self.also_create_otu} - has_one :type_taxon_name_relationship, -> { where("taxon_name_relationships.type LIKE 'TaxonNameRelationship::Typification::%'") }, class_name: 'TaxonNameRelationship', foreign_key: :object_taxon_name_id @@ -971,10 +969,6 @@ def name_is_valid_format rank_class.validate_name_format(self) if name.present? && rank_class && rank_class.respond_to?(:validate_name_format) && !has_latinized_exceptions? end - def create_otu - Otu.create(by: self.creator, project: self.project, taxon_name_id: self.id) - end - def new_parent_taxon_name r = self.iczn_uncertain_placement_relationship if r.present? From b40e39536780e4cc06839f1eb36a21c0d9a89ad4 Mon Sep 17 00:00:00 2001 From: mjy Date: Thu, 15 Feb 2024 16:22:46 -0600 Subject: [PATCH 34/48] Update TaxonName cluster validations * Move towards handling setting `cached_` values `after_commit`. This should help to eliminate the potential cascading touches on objects. * Updated original batch framework to save off by type, not row-by-row * TaxonName validate_parent_is_set is the same as one root per project, removed * Softened, but made more flexible cascading validation checks through `TaxonName#children` via changes to `TaxonName#parent_is_set?` * Removed the largely redundant subject/object validation in TaxonNameRelationship, this was added during Nomen batch load, and causes many redundant checks. Fixes to Batch save order made these unnecessary. --- app/models/taxon_name.rb | 56 +++++------- app/models/taxon_name_relationship.rb | 91 +++++++++---------- .../taxon_name_relationship/combination.rb | 9 +- lib/batch_load/import.rb | 17 ++-- .../import/taxon_names/nomen_interpreter.rb | 10 +- spec/files/batch/taxon_name/NomenTest.tab | 6 +- .../taxon_names/nomen_interpreter_spec.rb | 20 ++-- .../protonym/original_combinations_spec.rb | 35 +++---- spec/models/taxon_name/cached_spec.rb | 24 +++-- 9 files changed, 132 insertions(+), 136 deletions(-) diff --git a/app/models/taxon_name.rb b/app/models/taxon_name.rb index c432d86ae8..079fe8070f 100644 --- a/app/models/taxon_name.rb +++ b/app/models/taxon_name.rb @@ -206,34 +206,23 @@ def self.parent # to a new cached value, so let's record the old one # after_save :create_new_combination_if_absent - after_save :set_cached, unless: Proc.new {|n| n.no_cached || errors.any? } - after_save :set_cached_warnings, if: Proc.new {|n| n.no_cached } after_create :create_otu, if: :also_create_otu before_destroy :check_for_children, prepend: true - - validate :validate_rank_class_class, - # :check_format_of_name, - :validate_parent_from_the_same_project, - :validate_parent_is_set, - :check_new_rank_class, - :check_new_parent_class, - :validate_source_type, - :validate_one_root_per_project - - # TODO: remove, this is handled natively - validates_presence_of :type, message: 'is not specified' - + after_commit :set_cached, on: [:create, :update], unless: Proc.new {|n| n.no_cached || errors.any? } + after_commit :set_cached_warnings, on: [:create, :update], if: Proc.new {|n| n.no_cached } + + validate :validate_rank_class_class + validate :check_new_rank_class + validate :check_new_parent_class + validate :validate_source_type + validate :validate_parent_from_the_same_project + validate :validate_one_root_per_project + validates_presence_of :type, message: 'is not specified' # TODO: remove, this is handled natively, and in DB validates :year_of_publication, date_year: {min_year: 1000, max_year: Time.now.year + 5}, allow_nil: true # TODO: move some of these down to Protonym when they don't apply to Combination - # TODO: think of a different name, and test - has_many :historical_taxon_names, class_name: 'TaxonName', foreign_key: :cached_valid_taxon_name_id - - has_many :observation_matrix_row_items, as: :observation_object, inverse_of: :observation_object, class_name: 'ObservationMatrixRowItem::Dynamic::TaxonName', dependent: :destroy # was delete_all - has_many :observation_matrices, through: :observation_matrix_row_items - # TODO: revisit? belongs_to :valid_taxon_name, class_name: 'TaxonName', foreign_key: :cached_valid_taxon_name_id has_one :source_classified_as_relationship, -> { @@ -246,6 +235,12 @@ def self.parent has_one :source_classified_as, through: :source_classified_as_relationship, source: :object_taxon_name + # TODO: think of a different name, and test + has_many :historical_taxon_names, class_name: 'TaxonName', foreign_key: :cached_valid_taxon_name_id + + has_many :observation_matrix_row_items, as: :observation_object, inverse_of: :observation_object, class_name: 'ObservationMatrixRowItem::Dynamic::TaxonName', dependent: :destroy # was delete_all + has_many :observation_matrices, through: :observation_matrix_row_items + has_many :otus, inverse_of: :taxon_name, dependent: :restrict_with_error has_many :taxon_determinations, through: :otus has_many :collection_objects, through: :taxon_determinations, source: :biological_collection_object @@ -258,7 +253,6 @@ def self.parent has_many :taxon_name_classifications, dependent: :destroy, inverse_of: :taxon_name has_many :taxon_name_relationships, foreign_key: :subject_taxon_name_id, dependent: :restrict_with_error, inverse_of: :subject_taxon_name - # NOTE: Protonym subclassed methods might not be nicely tracked here, we'll have to see. Placement is after has_many relationships. (?) accepts_nested_attributes_for :related_taxon_name_relationships, allow_destroy: true, reject_if: proc { |attributes| attributes['type'].blank? || attributes['subject_taxon_name_id'].blank? } accepts_nested_attributes_for :family_group_name_form_relationship, allow_destroy: true, reject_if: proc { |attributes| attributes['object_taxon_name_id'].blank? } @@ -976,13 +970,15 @@ def first_possible_valid_taxon_name # returns list of invalid names for a given taxon. # Can't we just use #valid_id now? # DD: no this is used for validation of multiple conflicting relationships - # this list does not return combinations + # this list does not return Combinations def list_of_invalid_taxon_names first_pass = true list = {} while first_pass || !list.keys.select{|t| list[t] == false}.empty? do first_pass = false + list_of_taxa_to_check = list.empty? ? [self] : list.keys.select{|t| list[t] == false} + list_of_taxa_to_check.each do |t| potentialy_invalid_relationships = t.related_taxon_name_relationships.with_type_array(::TAXON_NAME_RELATIONSHIP_NAMES_SYNONYM).order_by_oldest_source_first potentialy_invalid_relationships.each do |r| @@ -996,7 +992,7 @@ def list_of_invalid_taxon_names end end return [] if list.empty? - list.sort_by{|t, a| (t.cached_nomenclature_date&.to_time || Time.now)}.collect{|t, a| t} + list.sort_by{|t, a| (t.cached_nomenclature_date&.to_time || Time.zone.now)}.collect{|t, a| t} end def gbif_status_array @@ -1482,11 +1478,6 @@ def get_cached_classified_as nil end - # @return [Boolean] - def parent_is_set? - !parent_id.nil? || (parent&.persisted?) - end - # TODO: this should be paginated, not all IDs! def next_sibling if siblings.where(project_id:).any? @@ -1642,10 +1633,9 @@ def check_for_children end end - def validate_parent_is_set - if !(rank_class == NomenclaturalRank) && !(type == 'Combination') - errors.add(:parent_id, 'is not selected') if !parent_is_set? - end + # @return [Boolean] + def parent_is_set? + parent_id.present? || parent # &.persisted? end def validate_parent_from_the_same_project diff --git a/app/models/taxon_name_relationship.rb b/app/models/taxon_name_relationship.rb index 9868ae692d..ff9b5eb43c 100644 --- a/app/models/taxon_name_relationship.rb +++ b/app/models/taxon_name_relationship.rb @@ -55,25 +55,16 @@ class TaxonNameRelationship < ApplicationRecord belongs_to :subject_taxon_name, class_name: 'TaxonName', inverse_of: :taxon_name_relationships # left side belongs_to :object_taxon_name, class_name: 'TaxonName', inverse_of: :related_taxon_name_relationships # right side - #has_one :family_group_name_form_relationship, -> {where(type: 'TaxonNameRelationship::Iczn::Invalidating::Usage::FamilyGroupNameForm')}, as: :subject_taxon_name, class_name: 'TaxonNameRelationship', inverse_of: :subject_taxon_name - - after_save :set_cached_names_for_taxon_names, unless: -> {self.no_cached} - after_destroy :set_cached_names_for_taxon_names, unless: -> {self.no_cached} + after_commit :set_cached_names_for_taxon_names, unless: -> {self.no_cached} # TODO: remove, it's required by STI validates_presence_of :type, message: 'Relationship type should be specified' - validates_presence_of :subject_taxon_name, message: 'Missing taxon name on the left side' validates_presence_of :object_taxon_name, message: 'Missing taxon name on the right side' - - validates_associated :subject_taxon_name - validates_associated :object_taxon_name - validates_uniqueness_of :object_taxon_name_id, scope: [:type, :project_id], if: :is_combination? validates_uniqueness_of :object_taxon_name_id, scope: [:type, :subject_taxon_name_id, :project_id], unless: :is_combination? validate :validate_type, :validate_subject_and_object_are_not_identical - validate :subject_and_object_in_same_project with_options unless: -> {!subject_taxon_name || !object_taxon_name} do @@ -330,7 +321,9 @@ def is_combination? def subject_and_object_in_same_project if subject_taxon_name && object_taxon_name - errors.add(:base, 'one name is not in the same project as the other') if subject_taxon_name.project_id != object_taxon_name.project_id + if subject_taxon_name.project_id != object_taxon_name.project_id + errors.add(:base, 'one name is not in the same project as the other') + end end end @@ -433,50 +426,56 @@ def validate_object_and_subject_both_protonyms end def set_cached_names_for_taxon_names - begin - TaxonName.transaction do - if is_invalidating? - t = subject_taxon_name - - if type_name =~/Misspelling/ - t.update_column(:cached_misspelling, t.get_cached_misspelling) - t.update_columns( - cached_author_year: t.get_author_and_year, - cached_nomenclature_date: t.nomenclature_date, - cached_original_combination: t.get_original_combination, - cached_original_combination_html: t.get_original_combination_html - ) - end + # !! only fire if subject_taxon_name changed + return true unless subject_taxon_name_id_previously_changed? - if type_name =~/Misapplication/ - t.update_columns( - cached_author_year: t.get_author_and_year, - cached_nomenclature_date: t.nomenclature_date) - end + TaxonName.transaction do + if is_invalidating? + t = subject_taxon_name - vn = t.get_valid_taxon_name + if type_name =~/Misspelling/ + t.update_column(:cached_misspelling, t.get_cached_misspelling) + t.update_columns( + cached_author_year: t.get_author_and_year, + cached_nomenclature_date: t.nomenclature_date, + cached_original_combination: t.get_original_combination, + cached_original_combination_html: t.get_original_combination_html) + end - n = t.get_full_name + if type_name =~/Misapplication/ t.update_columns( - cached: n, - cached_html: t.get_full_name_html(n), # OK to force reload here, otherwise we need an exception in #set_cached + cached_author_year: t.get_author_and_year, + cached_nomenclature_date: t.nomenclature_date) + end + + vn = t.get_valid_taxon_name + + # !! NO set cached should do this from TN side of things, + # !! Not here + + n = t.get_full_name + + t.update_columns( + cached: n, + cached_html: t.get_full_name_html(n), # OK to force reload here, otherwise we need an exception in #set_cached + cached_valid_taxon_name_id: vn.id, + cached_is_valid: !t.unavailable_or_invalid?) + t.combination_list_self.each do |c| + c.update_column(:cached_valid_taxon_name_id, vn.id) + end + + vn.list_of_invalid_taxon_names.each do |s| + s.update_columns( cached_valid_taxon_name_id: vn.id, - cached_is_valid: !t.unavailable_or_invalid?) - t.combination_list_self.each do |c| + cached_is_valid: !s.unavailable_or_invalid?) + s.combination_list_self.each do |c| c.update_column(:cached_valid_taxon_name_id, vn.id) end - - vn.list_of_invalid_taxon_names.each do |s| - s.update_columns( - cached_valid_taxon_name_id: vn.id, - cached_is_valid: !s.unavailable_or_invalid?) - s.combination_list_self.each do |c| - c.update_column(:cached_valid_taxon_name_id, vn.id) - end - end end end + end + true end @@ -673,7 +672,7 @@ def sv_fix_combination_relationship @@subclasses_preloaded = false def self.descendants unless @@subclasses_preloaded - Dir.glob("#{Rails.root}/app/models/taxon_name_relationship/**/*.rb") + Dir.glob("#{Rails.root.join("app/models/taxon_name_relationship/**/*.rb")}") .sort { |a, b| a.split('/').count <=> b.split('/').count } .map { |p| p.split('/app/models/').last.sub(/\.rb$/, '') } .map { |p| p.split('/') } diff --git a/app/models/taxon_name_relationship/combination.rb b/app/models/taxon_name_relationship/combination.rb index e53d2042d2..dd923acd94 100644 --- a/app/models/taxon_name_relationship/combination.rb +++ b/app/models/taxon_name_relationship/combination.rb @@ -66,12 +66,9 @@ def object_status_connector_to_subject protected def set_cached_names_for_taxon_names - begin - TaxonName.transaction do - t = object_taxon_name - t.send(:set_cached) - end - end + t = object_taxon_name + return true if t.destroyed? + t.send(:set_cached) true end diff --git a/lib/batch_load/import.rb b/lib/batch_load/import.rb index 80d757b8e1..a5df8da6bb 100644 --- a/lib/batch_load/import.rb +++ b/lib/batch_load/import.rb @@ -179,17 +179,22 @@ def line_strict_level_ok? def create @create_attempted = true - if ready_to_create? # TODO: DRY if a = save_order - sorted_processed_rows.each_value do |rp| - a.each do |k| - rp.objects[k].each do |o| - o.save unless o.persisted? + a.each do |k| + sorted_processed_rows.each_value do |rp| + rp.objects[k].each do |o| + begin + # puts o.name + o.save! unless o.persisted? + rescue ActiveRecord::RecordInvalid => o + a = o.record + o.record + end + end end - end end else diff --git a/lib/batch_load/import/taxon_names/nomen_interpreter.rb b/lib/batch_load/import/taxon_names/nomen_interpreter.rb index 8ed4582245..22648eef69 100644 --- a/lib/batch_load/import/taxon_names/nomen_interpreter.rb +++ b/lib/batch_load/import/taxon_names/nomen_interpreter.rb @@ -17,7 +17,7 @@ class Import::TaxonNames::NomenInterpreter < BatchLoad::Import # Required to handle some defaults attr_accessor :project_id - SAVE_ORDER = [:original_taxon_name, :taxon_name, :taxon_name_relationship, :otu] + SAVE_ORDER = [:taxon_name, :taxon_name_relationship, :otu] # :original_taxon_name, # @param [Hash] args def initialize(nomenclature_code: nil, parent_taxon_name_id: nil, also_create_otu: false, **args) @@ -32,6 +32,10 @@ def parent_taxon_name_id @parent_taxon_name_id || root_taxon_name.id end + def parent_taxon_name + TaxonName.find(parent_taxon_name_id) + end + def also_create_otu return true if [1, '1', true].include?(@also_create_otu) false @@ -57,7 +61,7 @@ def build_taxon_names parse_result = BatchLoad::RowParse.new parse_result.row_number = i # check vs. header etc. - parse_result.objects[:original_taxon_name] = [] + # parse_result.objects[:original_taxon_name] = [] # not used parse_result.objects[:taxon_name] = [] parse_result.objects[:taxon_name_relationship] = [] parse_result.objects[:otu] = [] @@ -122,7 +126,7 @@ def build_taxon_names taxon_names[taxon_name_id] = p if parent_id.blank? - p.parent_id = parent_taxon_name_id + p.parent = parent_taxon_name else if taxon_names[parent_id] p.parent = taxon_names[parent_id] diff --git a/spec/files/batch/taxon_name/NomenTest.tab b/spec/files/batch/taxon_name/NomenTest.tab index 43cd76047d..4b85c1f440 100644 --- a/spec/files/batch/taxon_name/NomenTest.tab +++ b/spec/files/batch/taxon_name/NomenTest.tab @@ -6,6 +6,6 @@ id taxon_name parent_id rank related_name_id related_name_nomen_class name_nomen 5 eus123 3 species TaxonNameClassification::Iczn::Unavailable::NotLatin 6 fus 4 species 7 gus 3 species 5 TaxonNameRelationship::Iczn::Invalidating::Synonym (Smith, 1920) https://my.uri/123 Cus nr. gus 22x -8 hus 4 species 6 TaxonNameRelationship::Iczn::Invalidating::Synonym (Jones) -9 ius 3 species 5 TaxonNameRelationship::Iczn::Invalidating::Synonym -10 jus 3 species 6 TaxonNameRelationship::Iczn::Invalidating::Synonym my_otu_name_22 +8 hus 4 species 6 TaxonNameRelationship::Iczn::Invalidating::Synonym::Suppression (Jones) +9 ius 3 species 5 TaxonNameRelationship::Iczn::Invalidating::Synonym::Subjective +10 jus 4 species 6 TaxonNameRelationship::Iczn::Invalidating::Synonym::Objective my_otu_name_22 diff --git a/spec/lib/batch_load/import/taxon_names/nomen_interpreter_spec.rb b/spec/lib/batch_load/import/taxon_names/nomen_interpreter_spec.rb index ad6616e5d0..2e63d151bd 100644 --- a/spec/lib/batch_load/import/taxon_names/nomen_interpreter_spec.rb +++ b/spec/lib/batch_load/import/taxon_names/nomen_interpreter_spec.rb @@ -27,21 +27,23 @@ let(:import) { BatchLoad::Import::TaxonNames::NomenInterpreter.new( **import_params ) } - #specify 'handle parent recursion errors gracefully' do - # f = Rack::Test::UploadedFile.new('spec/files/batch/taxon_name/NomenTestRecursive.tab') - # p = import_params - # p[:file] = f - # - # i = BatchLoad::Import::TaxonNames::NomenInterpreter.new( **p ) + #specify 'handle parent recursion errors gracefully' do + # f = Rack::Test::UploadedFile.new('spec/files/batch/taxon_name/NomenTestRecursive.tab') + # p = import_params + # p[:file] = f + # + # i = BatchLoad::Import::TaxonNames::NomenInterpreter.new( **p ) - # i.build - # expect(i.create).to be_truthy - #end + # i.build + # expect(i.create).to be_truthy + #end specify 'parent_taxon_name_id (provided)' do g = Protonym.create!(parent: root_taxon_name, name: 'Orderum', rank_class: Ranks.lookup(:iczn, :order)) + i = BatchLoad::Import::TaxonNames::NomenInterpreter.new( **import_params.merge(parent_taxon_name_id: g.id) ) i.create + expect(TaxonName.find_by(name: 'Aidae').parent_id).to eq(g.id) expect(TaxonName.find_by(name: 'Bidae').parent_id).to eq(g.id) end diff --git a/spec/models/protonym/original_combinations_spec.rb b/spec/models/protonym/original_combinations_spec.rb index bf3e8c595e..95fd7cf743 100644 --- a/spec/models/protonym/original_combinations_spec.rb +++ b/spec/models/protonym/original_combinations_spec.rb @@ -63,7 +63,7 @@ end context 'cached fields with verbatim_name set' do - before { species.update(verbatim_name: 'albo-nigra', original_genus: alternate_genus) } + before { species.update!(verbatim_name: 'albo-nigra', original_genus: alternate_genus) } specify '#cached_original_combination' do expect(species.cached_original_combination).to eq('Bus albo-nigra') @@ -105,68 +105,69 @@ end specify '#original_genus set' do - species.update(original_genus: genus) + species.update!(original_genus: genus) expect(species.cached_original_combination).to eq('Aus aus') end specify '#original_genus, #original_subgenus set' do - species.update(original_genus: genus, original_subgenus: genus) + species.update!(original_genus: genus, original_subgenus: genus) expect(species.cached_original_combination).to eq('Aus (Aus) aus') end specify '#original_genus, #original_subgenus, #original_species set' do - species.update(original_genus: genus, original_subgenus: genus, original_species: species) + species.update!(original_genus: genus, original_subgenus: genus, original_species: species) expect(species.cached_original_combination).to eq('Aus (Aus) aus') end specify '#original_genus, #original_subgenus, #original_species, #original_subspecies set' do - species.update(original_genus: genus, original_subgenus: genus, original_species: species, original_subspecies: species) + species.update!(original_genus: genus, original_subgenus: genus, original_species: species, original_subspecies: species) expect(species.cached_original_combination).to eq('Aus (Aus) aus aus') end specify '#original_genus, #original_subgenus, #original_species, #original_subspecies, #original_variety set' do - species.update(original_genus: genus, original_subgenus: genus, original_species: species, original_subspecies: species, original_variety: species) + species.update!(original_genus: genus, original_subgenus: genus, original_species: species, original_subspecies: species, original_variety: species) expect(species.cached_original_combination).to eq('Aus (Aus) aus aus var. aus') end specify '#original_genus, #original_subgenus, #original_species, #original_subspecies, #original_variety set' do - species.update(original_genus: genus, original_subgenus: genus, original_species: species, original_subspecies: species, original_variety: species) + species.update!(original_genus: genus, original_subgenus: genus, original_species: species, original_subspecies: species, original_variety: species) expect(species.cached_original_combination_html).to eq('Aus (Aus) aus aus var. aus') end specify 'subgenus original combination' do - alternate_genus.update(parent: genus, rank_class: Ranks.lookup(:iczn, :subgenus), original_genus: alternate_genus) + alternate_genus.update!(parent: genus, rank_class: Ranks.lookup(:iczn, :subgenus), original_genus: alternate_genus) expect(alternate_genus.cached_original_combination).to eq('Bus') end specify 'incomplete relationship: missing original species' do - species.update(original_genus: genus, original_subspecies: species) + species.update!(original_genus: genus, original_subspecies: species) expect(species.cached_original_combination).to eq('Aus [SPECIES NOT SPECIFIED] aus') end specify 'incomplete relationship: missing original genus 1' do - species.update(original_genus: nil, original_subgenus: genus) + species.update!(original_genus: nil, original_subgenus: genus) expect(species.cached_original_combination).to eq('[GENUS NOT SPECIFIED] (Aus) aus') end specify 'incomplete relationship: missing original genus 2' do - species.update(original_genus: nil, original_subgenus: genus) + species.update!(original_genus: nil, original_subgenus: genus) expect(species.cached_original_combination_html).to eq('[GENUS NOT SPECIFIED] (Aus) aus') end + # Creating a TNR does not reload the related object anymore specify 'misspelled original combination 1' do - alternate_genus.update(iczn_set_as_misspelling_of: genus, original_genus: alternate_genus) - expect(alternate_genus.cached_original_combination).to eq('Bus [sic]') + alternate_genus.update!(iczn_set_as_misspelling_of: genus, original_genus: alternate_genus) + expect(alternate_genus.reload.cached_original_combination).to eq('Bus [sic]') end specify 'misspelled original combination 2' do - alternate_genus.update(iczn_set_as_misspelling_of: genus, original_genus: alternate_genus) - expect(alternate_genus.cached_original_combination_html).to eq('Bus [sic]') + alternate_genus.update!(iczn_set_as_misspelling_of: genus, original_genus: alternate_genus) + expect(alternate_genus.reload.cached_original_combination_html).to eq('Bus [sic]') end specify 'misspelled original combination 3' do - alternate_genus.update(iczn_set_as_misspelling_of: genus, original_genus: alternate_genus) - species.update(original_genus: alternate_genus) + alternate_genus.update!(iczn_set_as_misspelling_of: genus, original_genus: alternate_genus) + species.update!(original_genus: alternate_genus) # touching this updates cached, so this differs from above 2 specs expect(species.cached_original_combination_html).to eq('Bus [sic] aus') end diff --git a/spec/models/taxon_name/cached_spec.rb b/spec/models/taxon_name/cached_spec.rb index ae4ac0b6cf..7191a26047 100644 --- a/spec/models/taxon_name/cached_spec.rb +++ b/spec/models/taxon_name/cached_spec.rb @@ -4,14 +4,15 @@ let(:root) { FactoryBot.create(:root_taxon_name) } - after(:all) do - TaxonNameRelationship.delete_all - TaxonName.delete_all - TaxonNameHierarchy.delete_all - # TODO: find out why this exists and resolve - presently leaving sources in the models - Citation.delete_all - Source.destroy_all - end + + # after(:all) do + # TaxonNameRelationship.delete_all + # TaxonName.delete_all + # TaxonNameHierarchy.delete_all + # # TODO: find out why this exists and resolve - presently leaving sources in the models + # Citation.delete_all + # Source.destroy_all + # end context 'quick test' do let(:genus) { Protonym.create(name: 'Erasmoneura', rank_class: Ranks.lookup(:iczn, 'genus'), parent: root) } @@ -26,10 +27,7 @@ specify '#not_specified 1' do species.update!(parent: root, original_genus: nil) - - # !! At this point species.cached == "[GENUS NOT SPECIFIED] vulnerata". See #2236 - - expect(species.reload.cached).to eq('[GENUS NOT SPECIFIED] vulnerata') + expect(species.cached).to eq('[GENUS NOT SPECIFIED] vulnerata') end end @@ -252,7 +250,7 @@ expect(species.not_binominal?).to be_falsey species.taxon_name_classifications.create(type: 'TaxonNameClassification::Iczn::Unavailable::NonBinominal') expect(species.not_binominal?).to be_truthy - species.reload +# species.reload species.save expect(species.cached_html).to eq('Cus aus') end From c2ba1e25f9b0c5f161ae1654fa70cc9c52301a87 Mon Sep 17 00:00:00 2001 From: mjy Date: Fri, 16 Feb 2024 12:19:37 -0600 Subject: [PATCH 35/48] Clean rspec app/models -t group:nomenclature --- app/models/protonym.rb | 9 +++++---- app/models/taxon_name.rb | 8 +++++--- app/models/taxon_name_relationship.rb | 5 +++++ spec/files/import_datasets/checklists/nomen_nudum.tsv | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/app/models/protonym.rb b/app/models/protonym.rb index 41d7df3987..cf02d1ab5f 100644 --- a/app/models/protonym.rb +++ b/app/models/protonym.rb @@ -1048,8 +1048,9 @@ def sv_cached_names # this cannot be moved to soft_validation_extensions end def set_cached - old_cached_html = cached_html.to_s - old_cached_author_year = cached_author_year.to_s + # old_cached_html = cached_html.to_s + old_cached_author_year = cached_author_year.to_s # why to_s? + old_cached = cached.to_s # why to_s? super set_cached_original_combination @@ -1058,8 +1059,8 @@ def set_cached set_cached_species_homonym if is_species_rank? set_cached_misspelling tn = TaxonName.find(id) - set_cached_names_for_descendants if tn.cached_html != old_cached_html - set_cached_names_for_dependants if tn.cached_html.to_s != old_cached_html || tn.cached_author_year.to_s != old_cached_author_year + set_cached_names_for_descendants if tn.cached != old_cached + set_cached_names_for_dependants if tn.cached.to_s != old_cached || tn.cached_author_year.to_s != old_cached_author_year end def set_cached_homonymy diff --git a/app/models/taxon_name.rb b/app/models/taxon_name.rb index 079fe8070f..17ddc1cf39 100644 --- a/app/models/taxon_name.rb +++ b/app/models/taxon_name.rb @@ -208,8 +208,11 @@ def self.parent after_create :create_otu, if: :also_create_otu before_destroy :check_for_children, prepend: true - after_commit :set_cached, on: [:create, :update], unless: Proc.new {|n| n.no_cached || errors.any? } - after_commit :set_cached_warnings, on: [:create, :update], if: Proc.new {|n| n.no_cached } + + # Rails 7 experiments have after_commit creating a whack-a-mole situation + # (though leave after_commit on TaxonNameRelationship) + after_save :set_cached, unless: Proc.new {|n| n.no_cached || errors.any? } + after_save :set_cached_warnings, if: Proc.new {|n| n.no_cached } validate :validate_rank_class_class validate :check_new_rank_class @@ -222,7 +225,6 @@ def self.parent # TODO: move some of these down to Protonym when they don't apply to Combination - belongs_to :valid_taxon_name, class_name: 'TaxonName', foreign_key: :cached_valid_taxon_name_id has_one :source_classified_as_relationship, -> { diff --git a/app/models/taxon_name_relationship.rb b/app/models/taxon_name_relationship.rb index ff9b5eb43c..390a023dcd 100644 --- a/app/models/taxon_name_relationship.rb +++ b/app/models/taxon_name_relationship.rb @@ -55,6 +55,8 @@ class TaxonNameRelationship < ApplicationRecord belongs_to :subject_taxon_name, class_name: 'TaxonName', inverse_of: :taxon_name_relationships # left side belongs_to :object_taxon_name, class_name: 'TaxonName', inverse_of: :related_taxon_name_relationships # right side + # !! Keep as after_commit unless you are wanting to spend a lot of time + # !! refactoring tests after_commit :set_cached_names_for_taxon_names, unless: -> {self.no_cached} # TODO: remove, it's required by STI @@ -460,6 +462,7 @@ def set_cached_names_for_taxon_names cached_html: t.get_full_name_html(n), # OK to force reload here, otherwise we need an exception in #set_cached cached_valid_taxon_name_id: vn.id, cached_is_valid: !t.unavailable_or_invalid?) + t.combination_list_self.each do |c| c.update_column(:cached_valid_taxon_name_id, vn.id) end @@ -468,10 +471,12 @@ def set_cached_names_for_taxon_names s.update_columns( cached_valid_taxon_name_id: vn.id, cached_is_valid: !s.unavailable_or_invalid?) + s.combination_list_self.each do |c| c.update_column(:cached_valid_taxon_name_id, vn.id) end end + end end diff --git a/spec/files/import_datasets/checklists/nomen_nudum.tsv b/spec/files/import_datasets/checklists/nomen_nudum.tsv index d5e70807dc..2258596d5d 100644 --- a/spec/files/import_datasets/checklists/nomen_nudum.tsv +++ b/spec/files/import_datasets/checklists/nomen_nudum.tsv @@ -1,4 +1,4 @@ -taxonID parentNameUsageID parentNameUsage acceptedNameUsageID acceptedNameUsage scientificName kingdom lass order family genus subgenus specificEpithet infraspecificEpithet taxonRank scientificNameAuthorship taxonomicStatus originalNameUsage originalNameUsageID namePublishedInYear nomenclaturalCode TW:TaxonNameClassification:Latinized:Gender TW:TaxonNameClassification:Latinized:PartOfSpeech +taxonID parentNameUsageID parentNameUsage acceptedNameUsageID acceptedNameUsage scientificName kingdom class order family genus subgenus specificEpithet infraspecificEpithet taxonRank scientificNameAuthorship taxonomicStatus originalNameUsage originalNameUsageID namePublishedInYear nomenclaturalCode TW:TaxonNameClassification:Latinized:Gender TW:TaxonNameClassification:Latinized:PartOfSpeech 429776 429776 Myrmica Latreille, 1804 Myrmica Animalia Insecta Hymenoptera Formicidae Genus Latreille, 1804 valid 429776 1804 ICZN 429929 429929 Leptothorax Mayr, 1855 Leptothorax Animalia Insecta Hymenoptera Formicidae Genus Mayr, 1855 valid 429929 1855 ICZN 429956 429956 Temnothorax Mayr, 1861 Temnothorax Animalia Insecta Hymenoptera Formicidae Genus Mayr, 1861 valid 429956 1861 ICZN From 725ffe7d90bd0e98ee62693d3a49da228d81f098 Mon Sep 17 00:00:00 2001 From: mjy Date: Fri, 16 Feb 2024 12:59:26 -0600 Subject: [PATCH 36/48] Replace destroyed? check on TNR impacting cached values. --- app/models/taxon_name_relationship.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/taxon_name_relationship.rb b/app/models/taxon_name_relationship.rb index 390a023dcd..cda1a13319 100644 --- a/app/models/taxon_name_relationship.rb +++ b/app/models/taxon_name_relationship.rb @@ -429,7 +429,7 @@ def validate_object_and_subject_both_protonyms def set_cached_names_for_taxon_names # !! only fire if subject_taxon_name changed - return true unless subject_taxon_name_id_previously_changed? + return true unless subject_taxon_name_id_previously_changed? || destroyed? TaxonName.transaction do if is_invalidating? From a88084afff76fb97e4c9636eba6a3b6ae36e8876 Mon Sep 17 00:00:00 2001 From: mjy Date: Fri, 16 Feb 2024 15:04:53 -0600 Subject: [PATCH 37/48] Return after_destroy with conditions to TaxonNameRelationship --- app/models/taxon_name_relationship.rb | 3 +- .../taxon_name_relationship/combination.rb | 2 +- .../original_combination.rb | 15 +- db/schema.rb | 435 +++++++++--------- 4 files changed, 229 insertions(+), 226 deletions(-) diff --git a/app/models/taxon_name_relationship.rb b/app/models/taxon_name_relationship.rb index cda1a13319..6f63dc468e 100644 --- a/app/models/taxon_name_relationship.rb +++ b/app/models/taxon_name_relationship.rb @@ -57,7 +57,8 @@ class TaxonNameRelationship < ApplicationRecord # !! Keep as after_commit unless you are wanting to spend a lot of time # !! refactoring tests - after_commit :set_cached_names_for_taxon_names, unless: -> {self.no_cached} + after_commit :set_cached_names_for_taxon_names, unless: -> {self.no_cached || destroyed?} + after_destroy :set_cached_names_for_taxon_names, unless: -> {self.no_cached} # TODO: remove, it's required by STI validates_presence_of :type, message: 'Relationship type should be specified' diff --git a/app/models/taxon_name_relationship/combination.rb b/app/models/taxon_name_relationship/combination.rb index dd923acd94..cef55a65ce 100644 --- a/app/models/taxon_name_relationship/combination.rb +++ b/app/models/taxon_name_relationship/combination.rb @@ -67,7 +67,7 @@ def object_status_connector_to_subject def set_cached_names_for_taxon_names t = object_taxon_name - return true if t.destroyed? + return true if t.destroyed? # Are we sure this is right? t.send(:set_cached) true end diff --git a/app/models/taxon_name_relationship/original_combination.rb b/app/models/taxon_name_relationship/original_combination.rb index b2bf2e762b..e14bcff6c8 100644 --- a/app/models/taxon_name_relationship/original_combination.rb +++ b/app/models/taxon_name_relationship/original_combination.rb @@ -62,7 +62,7 @@ def monominal_prefix # TODO: reconcile this format with that of full_name_hash def combination_name(name_gender = nil) elements = [monominal_prefix] - if !subject_taxon_name.verbatim_name.blank? && name_gender.nil? + if subject_taxon_name.verbatim_name.present? && name_gender.nil? elements.push subject_taxon_name.verbatim_name else elements.push subject_taxon_name.genderized_name(name_gender) @@ -82,15 +82,18 @@ def combination_name(name_gender = nil) protected def set_cached_names_for_taxon_names + begin TaxonName.transaction do t = object_taxon_name t.send(:set_cached) - t.update_columns( - cached_original_combination: t.get_original_combination, - cached_original_combination_html: t.get_original_combination_html, - cached_author_year: t.get_author_and_year, - ) + t.send(:set_cached_original_combination) + t.send(:set_cached_original_combination_html) +# t.update_columns( +# cached_original_combination: t.get_original_combination, +# cached_original_combination_html: t.get_original_combination_html, +# # cached_author_year: t.get_author_and_year, # is done in set_cached!! +# ) end end true diff --git a/db/schema.rb b/db/schema.rb index b673bff837..4625552535 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,8 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2024_02_09_173244) do - +ActiveRecord::Schema[7.1].define(version: 2024_02_09_173244) do # These are extensions that must be enabled in order to support this database enable_extension "btree_gin" enable_extension "fuzzystrmatch" @@ -26,8 +25,8 @@ t.text "value", null: false t.string "type", null: false t.integer "language_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.string "alternate_value_object_attribute" @@ -48,8 +47,8 @@ t.integer "project_id", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.boolean "is_absent" t.index ["created_by_id"], name: "index_asserted_distributions_on_created_by_id" t.index ["geographic_area_id"], name: "index_asserted_distributions_on_geographic_area_id" @@ -66,8 +65,8 @@ t.bigint "project_id", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["attribution_object_id"], name: "attr_obj_id_index" t.index ["attribution_object_type", "attribution_object_id"], name: "attribution_object_index" t.index ["attribution_object_type"], name: "attr_obj_type_index" @@ -80,8 +79,8 @@ t.integer "biocuration_class_id", null: false t.integer "biological_collection_object_id", null: false t.integer "position", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -99,8 +98,8 @@ t.string "biological_association_subject_type", null: false t.integer "biological_association_object_id", null: false t.string "biological_association_object_type", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -116,8 +115,8 @@ create_table "biological_associations_biological_associations_graphs", id: :serial, force: :cascade do |t| t.integer "biological_associations_graph_id", null: false t.integer "biological_association_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -129,8 +128,8 @@ end create_table "biological_associations_graphs", id: :serial, force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -145,8 +144,8 @@ t.string "type", null: false t.integer "biological_property_id", null: false t.integer "biological_relationship_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -162,8 +161,8 @@ t.string "name", null: false t.boolean "is_transitive" t.boolean "is_reflexive" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -178,8 +177,8 @@ t.bigint "geographic_item_id" t.bigint "translated_geographic_item_id" t.string "cached_map_type" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["cached_map_type"], name: "cmgit_cmt" t.index ["geographic_item_id", "translated_geographic_item_id", "cached_map_type"], name: "cmgit_translation", unique: true t.index ["geographic_item_id"], name: "cmgit_gi" @@ -196,8 +195,8 @@ t.string "level1_geographic_name" t.string "level2_geographic_name" t.bigint "project_id" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "untranslated" t.index ["geographic_item_id"], name: "index_cached_map_items_on_geographic_item_id" t.index ["otu_id", "geographic_item_id"], name: "index_cached_map_items_on_otu_id_and_geographic_item_id" @@ -209,8 +208,8 @@ t.string "cached_map_register_object_type" t.bigint "cached_map_register_object_id" t.bigint "project_id" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["cached_map_register_object_type", "cached_map_register_object_id"], name: "index_cached_map_registers_on_cached_map_register_object" t.index ["project_id"], name: "index_cached_map_registers_on_project_id" end @@ -220,8 +219,8 @@ t.geography "geometry", limit: {:srid=>4326, :type=>"geometry", :geographic=>true} t.integer "reference_count" t.bigint "project_id", null: false - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "cached_map_type", null: false t.index ["otu_id"], name: "index_cached_maps_on_otu_id" t.index ["project_id"], name: "index_cached_maps_on_project_id" @@ -235,8 +234,8 @@ t.integer "project_id" t.integer "updated_by_id", null: false t.integer "created_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "description_name" t.string "key_name" t.index ["created_by_id"], name: "index_character_states_on_created_by_id" @@ -251,8 +250,8 @@ t.integer "topic_id", null: false t.integer "citation_id", null: false t.string "pages" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -266,8 +265,8 @@ create_table "citations", id: :serial, force: :cascade do |t| t.string "citation_object_type", null: false t.integer "source_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -300,8 +299,8 @@ t.string "elevation_precision" t.text "field_notes" t.string "md5_of_verbatim_label" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.text "cached" t.integer "created_by_id", null: false t.integer "updated_by_id", null: false @@ -345,8 +344,8 @@ t.integer "project_id", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["created_by_id"], name: "index_collection_object_observations_on_created_by_id" t.index ["data"], name: "index_collection_object_observations_on_data" t.index ["project_id"], name: "index_collection_object_observations_on_project_id" @@ -356,8 +355,8 @@ create_table "collection_objects", id: :serial, force: :cascade do |t| t.integer "total" t.string "type", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "preparation_type_id" t.integer "repository_id" t.integer "created_by_id", null: false @@ -404,8 +403,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "collection_type" t.index ["collection_type"], name: "index_collection_profiles_on_collection_type" t.index ["container_id"], name: "index_collection_profiles_on_container_id" @@ -425,8 +424,8 @@ t.integer "project_id", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["created_by_id"], name: "index_common_names_on_created_by_id" t.index ["geographic_area_id"], name: "index_common_names_on_geographic_area_id" t.index ["language_id"], name: "index_common_names_on_language_id" @@ -437,14 +436,14 @@ end create_table "confidences", id: :serial, force: :cascade do |t| - t.integer "confidence_object_id", null: false t.string "confidence_object_type", null: false + t.integer "confidence_object_id", null: false t.integer "position", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "confidence_level_id", null: false t.index ["project_id"], name: "index_confidences_on_project_id" end @@ -458,8 +457,8 @@ end create_table "container_items", id: :serial, force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "contained_object_id", null: false t.string "contained_object_type", null: false t.string "disposition" @@ -477,8 +476,8 @@ end create_table "containers", id: :serial, force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "type", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false @@ -500,8 +499,8 @@ t.text "text", null: false t.integer "otu_id", null: false t.integer "topic_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -521,8 +520,8 @@ t.string "type", null: false t.string "name", null: false t.text "definition", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -548,8 +547,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["attribute_subject_id", "attribute_subject_type"], name: "index_data_attributes_on_attribute_subject_id_and_type" t.index ["attribute_subject_id"], name: "index_data_attributes_on_attribute_subject_id" t.index ["attribute_subject_type"], name: "index_data_attributes_on_attribute_subject_type" @@ -576,8 +575,8 @@ t.string "type", null: false t.string "status", null: false t.jsonb "metadata" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.bigint "project_id" @@ -594,13 +593,13 @@ t.integer "attempts", default: 0, null: false t.text "handler", null: false t.text "last_error" - t.datetime "run_at" - t.datetime "locked_at" - t.datetime "failed_at" + t.datetime "run_at", precision: nil + t.datetime "locked_at", precision: nil + t.datetime "failed_at", precision: nil t.string "locked_by" t.string "queue" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil t.index ["priority", "run_at"], name: "delayed_jobs_priority" end @@ -611,8 +610,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "position" t.text "caption" t.string "figure_label" @@ -638,8 +637,8 @@ t.integer "project_id", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["collection_object_id"], name: "dco_collection_object" t.index ["collection_object_observation_id"], name: "dco_collection_object_observation" t.index ["project_id"], name: "index_derived_collection_objects_on_project_id" @@ -652,8 +651,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "position" t.text "description" t.string "gene_attribute_logic" @@ -670,14 +669,14 @@ end create_table "documentation", id: :serial, force: :cascade do |t| - t.integer "documentation_object_id", null: false t.string "documentation_object_type", null: false + t.integer "documentation_object_id", null: false t.integer "document_id", null: false t.integer "project_id", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "position" t.index ["created_by_id"], name: "index_documentation_on_created_by_id" t.index ["document_id"], name: "index_documentation_on_document_id" @@ -689,13 +688,13 @@ create_table "documents", id: :serial, force: :cascade do |t| t.string "document_file_file_name", null: false t.string "document_file_content_type", null: false - t.integer "document_file_file_size", null: false - t.datetime "document_file_updated_at", null: false + t.bigint "document_file_file_size", null: false + t.datetime "document_file_updated_at", precision: nil, null: false t.integer "project_id", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.jsonb "page_map", default: {} t.integer "page_total" t.string "document_file_fingerprint" @@ -711,10 +710,10 @@ t.string "description" t.string "filename", null: false t.string "request" - t.datetime "expires", null: false + t.datetime "expires", precision: nil, null: false t.integer "times_downloaded", default: 0, null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.bigint "project_id" @@ -898,13 +897,13 @@ t.string "vernacularName" t.string "waterBody" t.string "year" - t.integer "dwc_occurrence_object_id" t.string "dwc_occurrence_object_type" + t.integer "dwc_occurrence_object_id" t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil t.string "identifiedByID" t.string "recordedByID" t.text "verbatimLabel" @@ -927,8 +926,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.bigint "repository_id" t.index ["project_id"], name: "index_extracts_on_project_id" t.index ["repository_id"], name: "index_extracts_on_repository_id" @@ -943,8 +942,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["controlled_vocabulary_term_id"], name: "index_gene_attributes_on_controlled_vocabulary_term_id" t.index ["project_id"], name: "index_gene_attributes_on_project_id" t.index ["sequence_id"], name: "index_gene_attributes_on_sequence_id" @@ -960,8 +959,8 @@ create_table "geographic_area_types", id: :serial, force: :cascade do |t| t.string "name", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.index ["created_by_id"], name: "index_geographic_area_types_on_created_by_id" @@ -976,8 +975,8 @@ t.integer "level2_id" t.integer "parent_id" t.integer "geographic_area_type_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "iso_3166_a2" t.string "iso_3166_a3" t.string "tdwgID" @@ -1001,16 +1000,16 @@ t.integer "origin_gid" t.string "date_valid_from" t.string "date_valid_to" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["data_origin"], name: "index_geographic_areas_geographic_items_on_data_origin" t.index ["geographic_area_id"], name: "index_geographic_areas_geographic_items_on_geographic_area_id" t.index ["geographic_item_id"], name: "index_geographic_areas_geographic_items_on_geographic_item_id" end create_table "geographic_items", id: :serial, force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.geography "point", limit: {:srid=>4326, :type=>"st_point", :has_z=>true, :geographic=>true} t.geography "line_string", limit: {:srid=>4326, :type=>"line_string", :has_z=>true, :geographic=>true} t.geography "polygon", limit: {:srid=>4326, :type=>"st_polygon", :has_z=>true, :geographic=>true} @@ -1043,8 +1042,8 @@ t.integer "error_geographic_item_id" t.string "type", null: false t.integer "position", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.boolean "is_public", default: false, null: false t.string "api_request" t.integer "created_by_id", null: false @@ -1068,8 +1067,8 @@ create_table "identifiers", id: :serial, force: :cascade do |t| t.string "identifier", null: false t.string "type", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "namespace_id" t.integer "created_by_id", null: false t.integer "updated_by_id", null: false @@ -1100,12 +1099,12 @@ t.string "image_file_fingerprint" t.integer "created_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "image_file_file_name" t.string "image_file_content_type" - t.integer "image_file_file_size" - t.datetime "image_file_updated_at" + t.bigint "image_file_file_size" + t.datetime "image_file_updated_at", precision: nil t.integer "updated_by_id", null: false t.text "image_file_meta" t.float "pixels_to_centimeter" @@ -1120,15 +1119,15 @@ t.string "status", null: false t.string "description", null: false t.jsonb "metadata" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.bigint "project_id" t.string "source_file_name" t.string "source_content_type" t.bigint "source_file_size" - t.datetime "source_updated_at" + t.datetime "source_updated_at", precision: nil t.index ["created_by_id"], name: "index_import_datasets_on_created_by_id" t.index ["project_id"], name: "index_import_datasets_on_project_id" t.index ["updated_by_id"], name: "index_import_datasets_on_updated_by_id" @@ -1137,8 +1136,8 @@ create_table "imports", id: :serial, force: :cascade do |t| t.string "name" t.hstore "metadata" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil t.json "metadata_json" end @@ -1153,8 +1152,8 @@ t.integer "project_id" t.integer "created_by_id" t.integer "updated_by_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "type" t.index ["created_by_id"], name: "labels_created_by_id_index" t.index ["label_object_type", "label_object_id"], name: "index_labels_on_label_object_type_and_label_object_id" @@ -1168,8 +1167,8 @@ t.string "alpha_2" t.string "english_name" t.string "french_name" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.index ["created_by_id"], name: "index_languages_on_created_by_id" @@ -1183,10 +1182,10 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "loan_item_object_id" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "loan_item_object_type" + t.integer "loan_item_object_id" t.integer "total" t.string "disposition" t.index ["created_by_id"], name: "index_loan_items_on_created_by_id" @@ -1211,11 +1210,11 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "recipient_honorific" t.string "recipient_country" - t.text "lender_address", default: "Lender's address not provided.", null: false + t.text "lender_address", null: false t.boolean "is_gift" t.index ["created_by_id"], name: "index_loans_on_created_by_id" t.index ["project_id"], name: "index_loans_on_project_id" @@ -1227,8 +1226,8 @@ t.string "institution" t.string "name", null: false t.string "short_name", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.string "verbatim_short_name" @@ -1245,8 +1244,8 @@ t.integer "note_object_id", null: false t.string "note_object_type", null: false t.string "note_object_attribute" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -1261,8 +1260,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["created_by_id"], name: "index_observation_matrices_on_created_by_id" t.index ["name"], name: "index_observation_matrices_on_name" t.index ["project_id"], name: "index_observation_matrices_on_project_id" @@ -1277,8 +1276,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "position" t.index ["controlled_vocabulary_term_id"], name: "omrc_cvt_index" t.index ["created_by_id"], name: "index_observation_matrix_column_items_on_created_by_id" @@ -1295,8 +1294,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "reference_count" t.integer "cached_observation_matrix_column_item_id" t.index ["created_by_id"], name: "index_observation_matrix_columns_on_created_by_id" @@ -1313,8 +1312,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "position" t.bigint "taxon_name_id" t.integer "observation_object_id" @@ -1334,8 +1333,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "reference_count" t.integer "cached_observation_matrix_row_item_id" t.string "name" @@ -1370,8 +1369,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "type", null: false t.integer "observation_object_id" t.string "observation_object_type" @@ -1403,24 +1402,24 @@ t.integer "parent_organization_id" t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["created_by_id"], name: "index_organizations_on_created_by_id" t.index ["name"], name: "index_organizations_on_name" t.index ["updated_by_id"], name: "index_organizations_on_updated_by_id" end create_table "origin_relationships", id: :serial, force: :cascade do |t| - t.integer "old_object_id", null: false t.string "old_object_type", null: false - t.integer "new_object_id", null: false + t.integer "old_object_id", null: false t.string "new_object_type", null: false + t.integer "new_object_id", null: false t.integer "position" t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["created_by_id"], name: "index_origin_relationships_on_created_by_id" t.index ["new_object_type", "new_object_id"], name: "index_origin_relationships_on_new_object_type_and_new_object_id" t.index ["old_object_type", "old_object_id"], name: "index_origin_relationships_on_old_object_type_and_old_object_id" @@ -1437,8 +1436,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["created_by_id"], name: "index_otu_page_layout_sections_on_created_by_id" t.index ["otu_page_layout_id"], name: "index_otu_page_layout_sections_on_otu_page_layout_id" t.index ["position"], name: "index_otu_page_layout_sections_on_position" @@ -1453,8 +1452,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["created_by_id"], name: "index_otu_page_layouts_on_created_by_id" t.index ["project_id"], name: "index_otu_page_layouts_on_project_id" t.index ["updated_by_id"], name: "index_otu_page_layouts_on_updated_by_id" @@ -1467,8 +1466,8 @@ t.bigint "project_id" t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["created_by_id"], name: "index_otu_relationships_on_created_by_id" t.index ["object_otu_id"], name: "index_otu_relationships_on_object_otu_id" t.index ["project_id"], name: "index_otu_relationships_on_project_id" @@ -1478,8 +1477,8 @@ create_table "otus", id: :serial, force: :cascade do |t| t.string "name" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -1496,8 +1495,8 @@ t.string "type", null: false t.string "last_name", null: false t.string "first_name" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "suffix" t.string "prefix" t.integer "created_by_id", null: false @@ -1516,8 +1515,8 @@ end create_table "pinboard_items", id: :serial, force: :cascade do |t| - t.integer "pinned_object_id", null: false t.string "pinned_object_type", null: false + t.integer "pinned_object_id", null: false t.integer "user_id", null: false t.integer "project_id", null: false t.integer "position", null: false @@ -1526,8 +1525,8 @@ t.integer "inserted_count" t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["created_by_id"], name: "index_pinboard_items_on_created_by_id" t.index ["pinned_object_type", "pinned_object_id"], name: "index_pinboard_items_on_pinned_object_type_and_pinned_object_id" t.index ["position"], name: "index_pinboard_items_on_position" @@ -1538,8 +1537,8 @@ create_table "preparation_types", id: :serial, force: :cascade do |t| t.string "name", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.text "definition", null: false @@ -1550,8 +1549,8 @@ create_table "project_members", id: :serial, force: :cascade do |t| t.integer "project_id", null: false t.integer "user_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.boolean "is_project_administrator" @@ -1567,8 +1566,8 @@ t.integer "source_id", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["created_by_id"], name: "index_project_sources_on_created_by_id" t.index ["project_id"], name: "index_project_sources_on_project_id" t.index ["source_id"], name: "index_project_sources_on_source_id" @@ -1577,11 +1576,11 @@ create_table "projects", id: :serial, force: :cascade do |t| t.string "name", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.jsonb "preferences", default: {}, null: false + t.jsonb "preferences", default: "{}", null: false t.string "api_access_token" t.string "data_curation_issue_tracker_url" t.index ["created_by_id"], name: "index_projects_on_created_by_id" @@ -1590,14 +1589,14 @@ create_table "protocol_relationships", id: :serial, force: :cascade do |t| t.integer "protocol_id", null: false - t.integer "protocol_relationship_object_id", null: false t.string "protocol_relationship_object_type", null: false + t.integer "protocol_relationship_object_id", null: false t.integer "position", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["project_id"], name: "index_protocol_relationships_on_project_id" t.index ["protocol_id"], name: "index_protocol_relationships_on_protocol_id" end @@ -1609,8 +1608,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["project_id"], name: "index_protocols_on_project_id" end @@ -1621,8 +1620,8 @@ t.integer "project_id", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "content_id", null: false t.index ["content_id"], name: "index_public_contents_on_content_id" t.index ["created_by_id"], name: "index_public_contents_on_created_by_id" @@ -1636,8 +1635,8 @@ t.string "name", null: false t.integer "minimum_value", null: false t.integer "maximum_value" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -1652,8 +1651,8 @@ t.string "acronym" t.string "status" t.string "institutional_LSID" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.boolean "is_index_herbariorum" @@ -1667,8 +1666,8 @@ t.integer "role_object_id", null: false t.string "role_object_type", null: false t.integer "position", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id" @@ -1690,8 +1689,8 @@ t.integer "object_sequence_id", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "project_id", null: false t.string "type", null: false end @@ -1699,8 +1698,8 @@ create_table "sequences", id: :serial, force: :cascade do |t| t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.text "sequence", null: false t.string "sequence_type", null: false t.integer "project_id", null: false @@ -1714,8 +1713,8 @@ t.integer "preceding_serial_id", null: false t.integer "succeeding_serial_id", null: false t.integer "created_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "updated_by_id", null: false t.string "type", null: false t.index ["created_by_id"], name: "index_serial_chronologies_on_created_by_id" @@ -1728,8 +1727,8 @@ create_table "serials", id: :serial, force: :cascade do |t| t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "place_published" t.integer "primary_language_id" t.integer "first_year_of_issue", limit: 2 @@ -1751,9 +1750,9 @@ t.string "unique_key", limit: 10, null: false t.string "category" t.integer "use_count", default: 0, null: false - t.datetime "expires_at" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "expires_at", precision: nil + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil t.index ["category"], name: "index_shortened_urls_on_category" t.index ["owner_id", "owner_type"], name: "index_shortened_urls_on_owner_id_and_owner_type" t.index ["unique_key"], name: "index_shortened_urls_on_unique_key", unique: true @@ -1770,8 +1769,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.bigint "project_id" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["created_by_id"], name: "index_sled_images_on_created_by_id" t.index ["image_id"], name: "index_sled_images_on_image_id" t.index ["project_id"], name: "index_sled_images_on_project_id" @@ -1808,8 +1807,8 @@ t.string "language" t.string "stated_year" t.string "verbatim" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "bibtex_type" t.integer "created_by_id", null: false t.integer "updated_by_id", null: false @@ -1850,16 +1849,16 @@ t.string "boundary_finder", null: false t.boolean "has_border", null: false t.string "layout", null: false - t.jsonb "metadata_map", default: {}, null: false - t.jsonb "specimen_coordinates", default: {}, null: false + t.jsonb "metadata_map", default: "{}", null: false + t.jsonb "specimen_coordinates", default: "{}", null: false t.integer "project_id", null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.jsonb "result_boundary_coordinates" t.jsonb "result_ocr" - t.datetime "in_progress" + t.datetime "in_progress", precision: nil t.index ["depiction_id"], name: "index_sqed_depictions_on_depiction_id" t.index ["project_id"], name: "index_sqed_depictions_on_project_id" end @@ -1870,8 +1869,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "keyword_id", null: false t.index ["created_by_id"], name: "index_tagged_section_keywords_on_created_by_id" t.index ["keyword_id"], name: "index_tagged_section_keywords_on_keyword_id" @@ -1886,8 +1885,8 @@ t.integer "tag_object_id", null: false t.string "tag_object_type", null: false t.string "tag_object_attribute" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -1906,8 +1905,8 @@ t.integer "biological_collection_object_id", null: false t.integer "otu_id", null: false t.integer "position", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -1926,8 +1925,8 @@ create_table "taxon_name_classifications", id: :serial, force: :cascade do |t| t.integer "taxon_name_id", null: false t.string "type", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -1952,8 +1951,8 @@ t.integer "subject_taxon_name_id", null: false t.integer "object_taxon_name_id", null: false t.string "type", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false @@ -1970,8 +1969,8 @@ t.integer "parent_id" t.string "cached_html" t.string "cached_author_year" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "year_of_publication" t.string "verbatim_author" t.string "rank_class" @@ -2023,8 +2022,8 @@ t.boolean "boolean" t.text "text" t.integer "integer" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil t.string "type" t.integer "sti_id" t.string "sti_type" @@ -2040,8 +2039,8 @@ t.integer "created_by_id", null: false t.integer "updated_by_id", null: false t.integer "project_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["collection_object_id"], name: "index_type_materials_on_collection_object_id" t.index ["created_by_id"], name: "index_type_materials_on_created_by_id" t.index ["project_id"], name: "index_type_materials_on_project_id" @@ -2053,17 +2052,17 @@ create_table "users", id: :serial, force: :cascade do |t| t.string "email", null: false t.string "password_digest", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "remember_token" t.integer "created_by_id" t.integer "updated_by_id" t.boolean "is_administrator" t.string "password_reset_token" - t.datetime "password_reset_token_date" + t.datetime "password_reset_token_date", precision: nil t.string "name", null: false - t.datetime "current_sign_in_at" - t.datetime "last_sign_in_at" + t.datetime "current_sign_in_at", precision: nil + t.datetime "last_sign_in_at", precision: nil t.string "current_sign_in_ip" t.string "last_sign_in_ip" t.text "hub_tab_order", default: [], array: true @@ -2072,7 +2071,7 @@ t.json "footprints", default: {} t.integer "sign_in_count", default: 0 t.json "hub_favorites" - t.datetime "last_seen_at" + t.datetime "last_seen_at", precision: nil t.integer "time_active", default: 0 t.json "preferences", default: {} t.bigint "person_id" @@ -2096,7 +2095,7 @@ t.string "event", null: false t.string "whodunnit" t.text "object" - t.datetime "created_at", null: false + t.datetime "created_at", precision: nil, null: false t.integer "transaction_id" t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id" t.index ["transaction_id"], name: "index_versions_on_transaction_id" From ba4198e0ec10b10a33a417f4d2e19e0703240797 Mon Sep 17 00:00:00 2001 From: mjy Date: Fri, 16 Feb 2024 15:09:11 -0600 Subject: [PATCH 38/48] Bundle update --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ac9e1ee8c5..1f427e3deb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -203,7 +203,7 @@ GEM citeproc-ruby (1.1.14) citeproc (~> 1.0, >= 1.0.9) csl (~> 1.6) - climate_control (0.2.0) + climate_control (1.2.0) closure_tree (7.4.0) activerecord (>= 4.2.10) with_advisory_lock (>= 4.0.0) @@ -425,7 +425,7 @@ GEM hashery (~> 2.0) ruby-rc4 ttfunk - pg (1.5.4) + pg (1.5.5) pkg-config (1.5.6) polyglot (0.3.5) postgresql_cursor (0.6.8) @@ -527,7 +527,7 @@ GEM rgeo (>= 1.0.0) rgeo-proj4 (4.0.0) rgeo (~> 3.0.0) - rmagick (5.4.2) + rmagick (5.4.4) observer (~> 0.1) pkg-config (~> 1.4) roo (2.10.1) @@ -666,8 +666,8 @@ GEM require_all (~> 3.0) term-ansicolor (1.7.1) tins (~> 1.0) - terrapin (0.6.0) - climate_control (>= 0.0.3, < 1.0) + terrapin (1.0.1) + climate_control terser (1.2.0) execjs (>= 0.3.0, < 3) thor (1.2.2) From 06963882ab9e44cf5f547063f785ddd125a0f16d Mon Sep 17 00:00:00 2001 From: mjy Date: Fri, 16 Feb 2024 15:11:37 -0600 Subject: [PATCH 39/48] Update zaru gem (filename sanitation) --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 9fd42ed027..c0f99e2fa9 100644 --- a/Gemfile +++ b/Gemfile @@ -151,7 +151,7 @@ gem 'logical_query_parser' gem 'logic_tools' gem 'chunky_png', '~> 1.4.0' gem 'namecase', '~> 2.0' -gem 'zaru', '~> 0.3.0' +gem 'zaru', '~> 1.0' # Export gem 'asciidoctor', '~> 2.0' diff --git a/Gemfile.lock b/Gemfile.lock index 1f427e3deb..fca27de01f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -719,7 +719,7 @@ GEM zeitwerk (>= 2.6) xpath (3.2.0) nokogiri (~> 1.8) - zaru (0.3.0) + zaru (1.0.0) zeitwerk (2.6.13) zip_tricks (5.6.0) @@ -858,7 +858,7 @@ DEPENDENCIES web-console (~> 4.0, >= 4.0.1) webmock (~> 3.8) wikidata-client (~> 0.1.0.pre.rc1) - zaru (~> 0.3.0) + zaru (~> 1.0) zip_tricks (~> 5.6) RUBY VERSION From cf348b0db39a1703ee0c4d00850965bcf851be1d Mon Sep 17 00:00:00 2001 From: mjy Date: Fri, 16 Feb 2024 15:12:37 -0600 Subject: [PATCH 40/48] Update shortener gem --- Gemfile | 2 +- Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index c0f99e2fa9..0bbe76ffe5 100644 --- a/Gemfile +++ b/Gemfile @@ -85,7 +85,7 @@ gem 'kt-paperclip', '~> 7.2' gem 'paperclip-meta', github: 'LocoDelAssembly/paperclip-meta', branch: 'kt-paperclip' gem 'voight_kampff', github: 'LocoDelAssembly/Voight-Kampff' -gem 'shortener', '~> 1.0.0' +gem 'shortener', '~> 1.0' gem 'rails_or', '~> 1.1.8' # javascript diff --git a/Gemfile.lock b/Gemfile.lock index fca27de01f..371f5dd73c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -837,7 +837,7 @@ DEPENDENCIES selenium-webdriver (~> 4.6, >= 4.6.1) serrano! shakapacker (= 7.2.2) - shortener (~> 1.0.0) + shortener (~> 1.0) simplecov spring-commands-rspec (~> 1.0.4) sprockets (~> 4.2) From e5f6694ee4ed9c833b9832c868a840b6b03bf3ce Mon Sep 17 00:00:00 2001 From: mjy Date: Fri, 16 Feb 2024 15:22:58 -0600 Subject: [PATCH 41/48] faker and brakeman gem updates --- Gemfile | 4 ++-- Gemfile.lock | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 0bbe76ffe5..6997804f9b 100644 --- a/Gemfile +++ b/Gemfile @@ -165,7 +165,7 @@ gem 'parallel', '~> 1.23' gem 'ruby-progressbar', '~> 1.11' group :test, :development do - gem 'faker', '~> 2.10' + gem 'faker', '~> 3.2' gem 'rspec-rails', '~> 6.1' gem 'rspec-activemodel-mocks', '~> 1.1.0' gem 'byebug', '~> 11.1', {}.merge(ENV['RM_INFO'] ? {require: false} : {}) @@ -193,7 +193,7 @@ group :development do gem 'rubocop-rspec', '~>2.6' gem 'rubocop-faker', '~> 1.1' gem 'rubocop-performance', '~> 1.10' - gem 'brakeman', '~> 5.1', '>= 4.6.1', require: false + gem 'brakeman', '~> 6.1', '>= 5.4', require: false gem 'seedbank', '~> 0.5.0' end diff --git a/Gemfile.lock b/Gemfile.lock index 371f5dd73c..30bb36ba69 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -183,7 +183,8 @@ GEM bindex (0.8.1) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) - brakeman (5.4.1) + brakeman (6.1.2) + racc builder (3.2.4) byebug (11.1.3) capybara (3.40.0) @@ -261,7 +262,7 @@ GEM factory_bot_rails (6.4.3) factory_bot (~> 6.4) railties (>= 5.0.0) - faker (2.23.0) + faker (3.2.3) i18n (>= 1.8.11, < 2) faraday (2.9.0) faraday-net_http (>= 2.0, < 3.2) @@ -743,7 +744,7 @@ DEPENDENCIES bibtex-ruby (~> 6.0) binding_of_caller biodiversity! - brakeman (~> 5.1, >= 4.6.1) + brakeman (~> 6.1, >= 5.4) bundler (~> 2.5) byebug (~> 11.1) capybara (~> 3.18) @@ -766,7 +767,7 @@ DEPENDENCIES exception_notification (~> 4.4) execjs (~> 2.8.1) factory_bot_rails (~> 6.2) - faker (~> 2.10) + faker (~> 3.2) ffi-geos (~> 2.4.0) gnfinder (~> 1.0) gpx! From fb0a69019d03cfd7b7230eb75c2e3bb3f47c2743 Mon Sep 17 00:00:00 2001 From: mjy Date: Fri, 16 Feb 2024 15:27:52 -0600 Subject: [PATCH 42/48] sdoc and net-smtp gem update --- Gemfile | 4 ++-- Gemfile.lock | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 6997804f9b..3b68ddf49b 100644 --- a/Gemfile +++ b/Gemfile @@ -30,7 +30,7 @@ gem 'roo-xls', '~> 1.2' gem 'csv', '~> 3.2' -gem 'net-smtp', '~> 0.3.1' +gem 'net-smtp', '~> 0.4' gem 'mail', '~> 2.8', '>= 2.8.1' gem 'matrix', '~> 0.4.2' @@ -198,7 +198,7 @@ group :development do end group :doc do - gem 'sdoc', '~> 2.2.0', require: false + gem 'sdoc', '~> 2.6', require: false end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 30bb36ba69..14261ae230 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -384,7 +384,7 @@ GEM net-protocol net-protocol (0.2.2) timeout - net-smtp (0.3.4) + net-smtp (0.4.0.1) net-protocol netrc (0.11.0) nio4r (2.7.0) @@ -615,7 +615,7 @@ GEM sprockets (> 3.0) sprockets-rails tilt - sdoc (2.2.0) + sdoc (2.6.1) rdoc (>= 5.0) seedbank (0.5.0) rake (>= 10.0) @@ -787,7 +787,7 @@ DEPENDENCIES matrix (~> 0.4.2) modularity (~> 3.0.0) namecase (~> 2.0) - net-smtp (~> 0.3.1) + net-smtp (~> 0.4) os (~> 1.0, >= 1.0.1) paper_trail (~> 15.0) paperclip-meta! @@ -833,7 +833,7 @@ DEPENDENCIES ruby-units (~> 2.3.0) rubyzip (~> 2.3.0) sassc-rails (~> 2.1.0) - sdoc (~> 2.2.0) + sdoc (~> 2.6) seedbank (~> 0.5.0) selenium-webdriver (~> 4.6, >= 4.6.1) serrano! From 6c95a0381fe1ff8cab0c6eae40f035d79501c453 Mon Sep 17 00:00:00 2001 From: mjy Date: Fri, 16 Feb 2024 15:41:38 -0600 Subject: [PATCH 43/48] Update CSL and related libraries --- Gemfile | 6 +++--- Gemfile.lock | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 3b68ddf49b..63cb6ef773 100644 --- a/Gemfile +++ b/Gemfile @@ -104,10 +104,10 @@ gem 'jquery-turbolinks', '~> 2.1' gem 'shakapacker', '7.2.2' # BibTeX handling -gem 'csl', '~> 1.6.0' +gem 'csl', '~> 2.0' gem 'bibtex-ruby', '~> 6.0' -gem 'citeproc-ruby', '~> 1.1.10' -gem 'csl-styles', '~> 1.0.1.8' +gem 'citeproc-ruby', '~> 2.0' +gem 'csl-styles', '~> 2.0.1' gem 'serrano', github: 'LocoDelAssembly/serrano', branch: 'older_thor' #gem 'serrano', '~> 1.0.0' # gem 'latex-decode', '~> 0.2.2' gem 'pdf-reader', '~> 2.2' diff --git a/Gemfile.lock b/Gemfile.lock index 14261ae230..b139410960 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -201,9 +201,9 @@ GEM chunky_png (1.4.0) citeproc (1.0.10) namae (~> 1.0) - citeproc-ruby (1.1.14) + citeproc-ruby (2.0.0) citeproc (~> 1.0, >= 1.0.9) - csl (~> 1.6) + csl (~> 2.0) climate_control (1.2.0) closure_tree (7.4.0) activerecord (>= 4.2.10) @@ -221,11 +221,11 @@ GEM bigdecimal rexml crass (1.0.6) - csl (1.6.0) + csl (2.0.0) namae (~> 1.0) rexml - csl-styles (1.0.1.11) - csl (~> 1.0) + csl-styles (2.0.1) + csl (~> 2.0) csv (3.2.8) daemons (1.4.1) database_cleaner (2.0.2) @@ -751,12 +751,12 @@ DEPENDENCIES chartkick (~> 4.0) chronic (~> 0.10.2) chunky_png (~> 1.4.0) - citeproc-ruby (~> 1.1.10) + citeproc-ruby (~> 2.0) closure_tree (~> 7.0) codecov (~> 0.6.0) colrapi (~> 0.1.1) - csl (~> 1.6.0) - csl-styles (~> 1.0.1.8) + csl (~> 2.0) + csl-styles (~> 2.0.1) csv (~> 3.2) daemons (~> 1.4.1) database_cleaner (~> 2.0) From 34ed5050e6ccee04a5e796e9e18f7808de0a5b2f Mon Sep 17 00:00:00 2001 From: mjy Date: Fri, 16 Feb 2024 15:45:18 -0600 Subject: [PATCH 44/48] Update chartkick and groupdate gems --- Gemfile | 4 ++-- Gemfile.lock | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 63cb6ef773..c2c4a7dc6d 100644 --- a/Gemfile +++ b/Gemfile @@ -113,8 +113,8 @@ gem 'serrano', github: 'LocoDelAssembly/serrano', branch: 'older_thor' #gem 'ser gem 'pdf-reader', '~> 2.2' # UI/UX -gem 'chartkick', '~> 4.0' -gem 'groupdate', '~> 5.2' +gem 'chartkick', '~> 5.0' +gem 'groupdate', '~> 6.4' gem 'dropzonejs-rails', '~> 0.8.1' gem 'kaminari', '~> 1.2.0' gem 'best_in_place', git: 'https://github.com/mmotherwell/best_in_place' diff --git a/Gemfile.lock b/Gemfile.lock index b139410960..4904935404 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -196,7 +196,7 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - chartkick (4.2.1) + chartkick (5.0.5) chronic (0.10.2) chunky_png (1.4.0) citeproc (1.0.10) @@ -281,8 +281,8 @@ GEM activesupport (>= 6.1) gnfinder (1.0.4) rest-client (~> 2.1) - groupdate (5.2.4) - activesupport (>= 5) + groupdate (6.4.0) + activesupport (>= 6.1) guard (2.18.1) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) @@ -748,7 +748,7 @@ DEPENDENCIES bundler (~> 2.5) byebug (~> 11.1) capybara (~> 3.18) - chartkick (~> 4.0) + chartkick (~> 5.0) chronic (~> 0.10.2) chunky_png (~> 1.4.0) citeproc-ruby (~> 2.0) @@ -771,7 +771,7 @@ DEPENDENCIES ffi-geos (~> 2.4.0) gnfinder (~> 1.0) gpx! - groupdate (~> 5.2) + groupdate (~> 6.4) guard-rspec (~> 4.7.3) hiredis (~> 0.6.1) indefinite_article (~> 0.2.4) From 67e853c4a0b7a5b1e0177ab9ba0b2fd028c01ae7 Mon Sep 17 00:00:00 2001 From: mjy Date: Fri, 16 Feb 2024 16:29:47 -0600 Subject: [PATCH 45/48] Revert to use deprecate method --- app/models/concerns/shared/polymorphic_annotator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/concerns/shared/polymorphic_annotator.rb b/app/models/concerns/shared/polymorphic_annotator.rb index 58de4d3200..0e469f5ed1 100644 --- a/app/models/concerns/shared/polymorphic_annotator.rb +++ b/app/models/concerns/shared/polymorphic_annotator.rb @@ -64,7 +64,8 @@ def self.polymorphic_annotates(polymorphic_belongs, foreign_key: nil, inverse_of belongs_to(polymorphic_belongs.to_sym, polymorphic: true, foreign_key: (foreign_key.nil? ? (polymorphic_belongs.to_s + '_id').to_s : polymorphic_belongs.to_s), inverse_of:) - alias_method :annotated_object, polymorphic_belongs.to_sym + alias_attribute :annotated_object, polymorphic_belongs.to_sym +# alias_method :annotated_object, polymorphic_belongs.to_sym define_singleton_method(:annotator_reflection){polymorphic_belongs.to_s} From fe2ddb55419d93a6b1a7593cb5d9383ea9d6fb7e Mon Sep 17 00:00:00 2001 From: mjy Date: Sat, 17 Feb 2024 14:18:48 -0600 Subject: [PATCH 46/48] Refactor to remove deprecated annotated_object --- app/models/concerns/shared/polymorphic_annotator.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/concerns/shared/polymorphic_annotator.rb b/app/models/concerns/shared/polymorphic_annotator.rb index 0e469f5ed1..7b7ad7a460 100644 --- a/app/models/concerns/shared/polymorphic_annotator.rb +++ b/app/models/concerns/shared/polymorphic_annotator.rb @@ -46,6 +46,8 @@ def related_klasses included do + attr_accessor :annotated_object + # Concern implementation macro # # @param foreign_key [String, nil] @@ -64,8 +66,8 @@ def self.polymorphic_annotates(polymorphic_belongs, foreign_key: nil, inverse_of belongs_to(polymorphic_belongs.to_sym, polymorphic: true, foreign_key: (foreign_key.nil? ? (polymorphic_belongs.to_s + '_id').to_s : polymorphic_belongs.to_s), inverse_of:) - alias_attribute :annotated_object, polymorphic_belongs.to_sym -# alias_method :annotated_object, polymorphic_belongs.to_sym + alias_method :annotated_object, polymorphic_belongs.to_sym + alias_method :annotated_object=, (polymorphic_belongs.to_s + '=').to_sym define_singleton_method(:annotator_reflection){polymorphic_belongs.to_s} From d9ae8f2a7416edb886f405e89cf3393f63b6bf15 Mon Sep 17 00:00:00 2001 From: mjy Date: Sun, 25 Feb 2024 09:51:25 -0600 Subject: [PATCH 47/48] Bundle update --- Gemfile.lock | 117 +++++++++++++++++++++++++-------------------------- 1 file changed, 57 insertions(+), 60 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 40be77078d..11726a4467 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -79,35 +79,35 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.1.0) - actioncable (7.1.3) - actionpack (= 7.1.3) - activesupport (= 7.1.3) + actioncable (7.1.3.2) + actionpack (= 7.1.3.2) + activesupport (= 7.1.3.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3) - actionpack (= 7.1.3) - activejob (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) + actionmailbox (7.1.3.2) + actionpack (= 7.1.3.2) + activejob (= 7.1.3.2) + activerecord (= 7.1.3.2) + activestorage (= 7.1.3.2) + activesupport (= 7.1.3.2) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.3) - actionpack (= 7.1.3) - actionview (= 7.1.3) - activejob (= 7.1.3) - activesupport (= 7.1.3) + actionmailer (7.1.3.2) + actionpack (= 7.1.3.2) + actionview (= 7.1.3.2) + activejob (= 7.1.3.2) + activesupport (= 7.1.3.2) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.3) - actionview (= 7.1.3) - activesupport (= 7.1.3) + actionpack (7.1.3.2) + actionview (= 7.1.3.2) + activesupport (= 7.1.3.2) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -115,38 +115,38 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.3) - actionpack (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) + actiontext (7.1.3.2) + actionpack (= 7.1.3.2) + activerecord (= 7.1.3.2) + activestorage (= 7.1.3.2) + activesupport (= 7.1.3.2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3) - activesupport (= 7.1.3) + actionview (7.1.3.2) + activesupport (= 7.1.3.2) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.3) - activesupport (= 7.1.3) + activejob (7.1.3.2) + activesupport (= 7.1.3.2) globalid (>= 0.3.6) - activemodel (7.1.3) - activesupport (= 7.1.3) - activerecord (7.1.3) - activemodel (= 7.1.3) - activesupport (= 7.1.3) + activemodel (7.1.3.2) + activesupport (= 7.1.3.2) + activerecord (7.1.3.2) + activemodel (= 7.1.3.2) + activesupport (= 7.1.3.2) timeout (>= 0.4.0) activerecord-postgis-adapter (9.0.1) activerecord (~> 7.1.0) rgeo-activerecord (~> 7.0.0) - activestorage (7.1.3) - actionpack (= 7.1.3) - activejob (= 7.1.3) - activerecord (= 7.1.3) - activesupport (= 7.1.3) + activestorage (7.1.3.2) + actionpack (= 7.1.3.2) + activejob (= 7.1.3.2) + activerecord (= 7.1.3.2) + activesupport (= 7.1.3.2) marcel (~> 1.0) - activesupport (7.1.3) + activesupport (7.1.3.2) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -162,7 +162,7 @@ GEM public_suffix (>= 2.0.2, < 6.0) afm (0.2.2) amazing_print (1.5.0) - asciidoctor (2.0.20) + asciidoctor (2.0.21) ast (2.4.2) babel-source (5.8.35) babel-transpiler (0.7.0) @@ -248,7 +248,6 @@ GEM ruby2_keywords dropzonejs-rails (0.8.5) rails (> 3.1) - dwc_agent (3.1.1.0) dwc_agent (3.1.1.0) namae (~> 1) namecase (~> 2) @@ -345,7 +344,7 @@ GEM language_server-protocol (3.17.0.3) latex-decode (0.4.0) link_header (0.0.8) - listen (3.8.0) + listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logic_tools (0.3.9) @@ -428,7 +427,6 @@ GEM ruby-rc4 ttfunk pg (1.5.5) - pg (1.5.5) pkg-config (1.5.6) polyglot (0.3.5) postgresql_cursor (0.6.8) @@ -457,20 +455,20 @@ GEM rackup (1.0.0) rack (< 3) webrick - rails (7.1.3) - actioncable (= 7.1.3) - actionmailbox (= 7.1.3) - actionmailer (= 7.1.3) - actionpack (= 7.1.3) - actiontext (= 7.1.3) - actionview (= 7.1.3) - activejob (= 7.1.3) - activemodel (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) + rails (7.1.3.2) + actioncable (= 7.1.3.2) + actionmailbox (= 7.1.3.2) + actionmailer (= 7.1.3.2) + actionpack (= 7.1.3.2) + actiontext (= 7.1.3.2) + actionview (= 7.1.3.2) + activejob (= 7.1.3.2) + activemodel (= 7.1.3.2) + activerecord (= 7.1.3.2) + activestorage (= 7.1.3.2) + activesupport (= 7.1.3.2) bundler (>= 1.15.0) - railties (= 7.1.3) + railties (= 7.1.3.2) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -486,9 +484,9 @@ GEM rails (>= 3.2) rails_or (1.1.9) activerecord (>= 3) - railties (7.1.3) - actionpack (= 7.1.3) - activesupport (= 7.1.3) + railties (7.1.3.2) + actionpack (= 7.1.3.2) + activesupport (= 7.1.3.2) irb rackup (>= 1.0.0) rake (>= 12.2) @@ -507,7 +505,7 @@ GEM redcarpet (3.6.0) redis (4.8.1) regexp_parser (2.9.0) - reline (0.4.2) + reline (0.4.3) io-console (~> 0.5) request_store (1.6.0) rack (>= 1.4) @@ -530,7 +528,6 @@ GEM rgeo (>= 1.0.0) rgeo-proj4 (4.0.0) rgeo (~> 3.0.0) - rmagick (5.4.4) rmagick (5.4.4) observer (~> 0.1) pkg-config (~> 1.4) @@ -567,7 +564,7 @@ GEM rspec-expectations (~> 3.12) rspec-mocks (~> 3.12) rspec-support (~> 3.12) - rspec-support (3.13.0) + rspec-support (3.13.1) rtesseract (3.1.3) rubocop (1.60.2) json (~> 2.3) From 941cf5bba65f520aebbaba6131c986c086068e8f Mon Sep 17 00:00:00 2001 From: mjy Date: Thu, 4 Apr 2024 10:25:10 -0500 Subject: [PATCH 48/48] Bundle update --- Gemfile.lock | 122 ++++++++++++++++++++++++++------------------------- 1 file changed, 62 insertions(+), 60 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 94f4ba3a65..68bba718c6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,10 @@ GIT remote: https://github.com/GlobalNamesArchitecture/biodiversity.git - revision: e9dbc57cfa0d70a8145b7d1385df64456fc5457b + revision: f8d55f8909984d61540ae821b5719f66c1dfd856 branch: pipe_approach specs: - biodiversity (5.3.3) - ffi (~> 1.14) + biodiversity (5.9.1) + ffi (~> 1.15) GIT remote: https://github.com/LocoDelAssembly/Voight-Kampff.git @@ -15,11 +15,11 @@ GIT GIT remote: https://github.com/LocoDelAssembly/dwc-archive.git - revision: c2243e26a3884af64f3295ad30f26306a16df38a + revision: 8fffe78690b5e988f3a303657e32cf7ddb9f561e branch: overhaul specs: dwc-archive (1.1.4) - biodiversity (~> 5.3.0) + biodiversity (~> 5.3) nokogiri (~> 1.11) GIT @@ -161,8 +161,8 @@ GEM addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) afm (0.2.2) - amazing_print (1.5.0) - asciidoctor (2.0.21) + amazing_print (1.6.0) + asciidoctor (2.0.22) ast (2.4.2) babel-source (5.8.35) babel-transpiler (0.7.0) @@ -179,10 +179,10 @@ GEM bibtex-ruby (6.1.0) latex-decode (~> 0.0) racc (~> 1.7) - bigdecimal (3.1.6) + bigdecimal (3.1.7) bindex (0.8.1) - binding_of_caller (1.0.0) - debug_inspector (>= 0.0.1) + binding_of_caller (1.0.1) + debug_inspector (>= 1.2.0) brakeman (6.1.2) racc builder (3.2.4) @@ -196,7 +196,7 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - chartkick (5.0.5) + chartkick (5.0.6) chronic (0.10.2) chunky_png (1.4.0) citeproc (1.0.10) @@ -226,7 +226,7 @@ GEM rexml csl-styles (2.0.1) csl (~> 2.0) - csv (3.2.8) + csv (3.3.0) daemons (1.4.1) database_cleaner (2.0.2) database_cleaner-active_record (>= 2, < 3) @@ -244,8 +244,7 @@ GEM diff-lcs (1.5.1) docile (1.4.0) domain_name (0.6.20240107) - drb (2.2.0) - ruby2_keywords + drb (2.2.1) dropzonejs-rails (0.8.5) rails (> 3.1) dwc_agent (3.1.1.0) @@ -255,14 +254,14 @@ GEM exception_notification (4.5.0) actionmailer (>= 5.2, < 8) activesupport (>= 5.2, < 8) - excon (0.109.0) + excon (0.110.0) execjs (2.8.1) factory_bot (6.4.6) activesupport (>= 5.0.0) factory_bot_rails (6.4.3) factory_bot (~> 6.4) railties (>= 5.0.0) - faker (3.2.3) + faker (3.3.1) i18n (>= 1.8.11, < 2) faraday (2.9.0) faraday-net_http (>= 2.0, < 3.2) @@ -304,12 +303,12 @@ GEM http-accept (1.7.0) http-cookie (1.0.5) domain_name (~> 0.5) - i18n (1.14.1) + i18n (1.14.4) concurrent-ruby (~> 1.0) indefinite_article (0.2.5) activesupport io-console (0.7.2) - irb (1.11.2) + irb (1.12.0) rdoc reline (>= 0.4.2) jbuilder (2.11.5) @@ -322,7 +321,7 @@ GEM jquery-turbolinks (2.1.0) railties (>= 3.1.0) turbolinks - json (2.7.1) + json (2.7.2) kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -360,14 +359,14 @@ GEM net-imap net-pop net-smtp - marcel (1.0.3) + marcel (1.0.4) matrix (0.4.2) method_source (1.0.0) mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2024.0206) + mime-types-data (3.2024.0305) mini_mime (1.1.5) - minitest (5.22.2) + minitest (5.22.3) modularity (3.0.1) multi_json (1.15.0) mutex_m (0.2.0) @@ -384,21 +383,21 @@ GEM net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0.1) + net-smtp (0.5.0) net-protocol netrc (0.11.0) - nio4r (2.7.0) - nokogiri (1.16.2-aarch64-linux) + nio4r (2.7.1) + nokogiri (1.16.3-aarch64-linux) racc (~> 1.4) - nokogiri (1.16.2-arm-linux) + nokogiri (1.16.3-arm-linux) racc (~> 1.4) - nokogiri (1.16.2-arm64-darwin) + nokogiri (1.16.3-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.2-x86-linux) + nokogiri (1.16.3-x86-linux) racc (~> 1.4) - nokogiri (1.16.2-x86_64-darwin) + nokogiri (1.16.3-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.2-x86_64-linux) + nokogiri (1.16.3-x86_64-linux) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) @@ -410,7 +409,7 @@ GEM activerecord (>= 6.1) request_store (~> 1.4) parallel (1.24.0) - parallel_tests (4.5.1) + parallel_tests (4.6.1) parallel parser (3.3.0.5) ast (~> 2.4.1) @@ -426,7 +425,7 @@ GEM hashery (~> 2.0) ruby-rc4 ttfunk - pg (1.5.5) + pg (1.5.6) pkg-config (1.5.6) polyglot (0.3.5) postgresql_cursor (0.6.8) @@ -439,12 +438,12 @@ GEM method_source (~> 1.0) psych (5.1.2) stringio - public_suffix (5.0.4) + public_suffix (5.0.5) puma (6.4.2) nio4r (~> 2.0) racc (1.7.3) - rack (2.2.8.1) - rack-cors (2.0.1) + rack (2.2.9) + rack-cors (2.0.2) rack (>= 2.0.0) rack-proxy (0.7.7) rack @@ -493,19 +492,19 @@ GEM thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.1.0) + rake (13.2.0) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) rdf (3.3.1) bcp47_spec (~> 0.2) link_header (~> 0.0, >= 0.0.8) - rdoc (6.6.2) + rdoc (6.6.3.1) psych (>= 4.0.0) redcarpet (3.6.0) redis (4.8.1) regexp_parser (2.9.0) - reline (0.4.3) + reline (0.5.0) io-console (~> 0.5) request_store (1.6.0) rack (>= 1.4) @@ -538,7 +537,7 @@ GEM nokogiri roo (>= 2.0.0, < 3) spreadsheet (> 0.9.0) - rouge (4.2.0) + rouge (4.2.1) rqrcode_core (1.2.0) rspec (3.13.0) rspec-core (~> 3.13.0) @@ -556,17 +555,17 @@ GEM rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (6.1.1) + rspec-rails (6.1.2) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.12) - rspec-expectations (~> 3.12) - rspec-mocks (~> 3.12) - rspec-support (~> 3.12) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) rspec-support (3.13.1) rtesseract (3.1.3) - rubocop (1.61.0) + rubocop (1.62.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -574,10 +573,10 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.1) + rubocop-ast (1.31.2) parser (>= 3.3.0.4) rubocop-capybara (2.20.0) rubocop (~> 1.41) @@ -586,26 +585,28 @@ GEM rubocop-faker (1.1.0) faker (>= 2.12.0) rubocop (>= 0.82.0) - rubocop-performance (1.20.2) + rubocop-performance (1.21.0) rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) - rubocop-rails (2.23.1) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.24.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) - rubocop-rspec (2.27.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rspec (2.28.0) rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.28.2) + rubocop (~> 1.40) ruby-graphviz (1.2.5) rexml - ruby-ole (1.2.12.2) + ruby-ole (1.2.13.1) ruby-prof (1.7.0) ruby-progressbar (1.13.0) ruby-rc4 (0.1.5) ruby-units (2.3.2) - ruby2_keywords (0.0.5) rubyzip (2.3.2) sassc (2.4.0) ffi (~> 1.9) @@ -619,13 +620,13 @@ GEM rdoc (>= 5.0) seedbank (0.5.0) rake (>= 10.0) - selenium-webdriver (4.18.1) + selenium-webdriver (4.19.0) base64 (~> 0.2) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) semantic_range (3.0.0) - shakapacker (7.2.2) + shakapacker (7.2.3) activesupport (>= 5.2) package_json rack-proxy (>= 0.6.1) @@ -665,11 +666,11 @@ GEM sync (0.5.0) taxonifi (0.6.0) require_all (~> 3.0) - term-ansicolor (1.7.1) + term-ansicolor (1.7.2) tins (~> 1.0) terrapin (1.0.1) climate_control - terser (1.2.0) + terser (1.2.2) execjs (>= 0.3.0, < 3) thor (1.2.2) tilt (2.3.0) @@ -680,7 +681,8 @@ GEM sync treetop (1.6.12) polyglot (~> 0.3) - ttfunk (1.7.0) + ttfunk (1.8.0) + bigdecimal (~> 3.1) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) @@ -837,7 +839,7 @@ DEPENDENCIES seedbank (~> 0.5.0) selenium-webdriver (~> 4.6, >= 4.6.1) serrano! - shakapacker (= 7.2.2) + shakapacker (= 7.2.3) shortener (~> 1.0) simplecov spring-commands-rspec (~> 1.0.4)