From 1369a3c7b7999dcd626843594ad94585a4a73ae2 Mon Sep 17 00:00:00 2001 From: Randall Floyd Date: Thu, 2 Oct 2025 16:06:53 -0400 Subject: [PATCH 1/5] Resolving conflicts when changing gemspecs to use Rails 8 --- .dassie/Gemfile | 7 ++++++- .koppie/Gemfile | 6 +++++- .koppie/db/schema.rb | 4 ++-- hyrax.gemspec | 4 ++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.dassie/Gemfile b/.dassie/Gemfile index cd769ca88b..efc1e7b8c0 100644 --- a/.dassie/Gemfile +++ b/.dassie/Gemfile @@ -30,6 +30,11 @@ if RUBY_PLATFORM =~ /musl/ end gem 'hydra-role-management' +gem 'hydra-editor', git: 'https://github.com/samvera/hydra-editor.git', branch: 'rails-8' +gem 'hydra-derivatives', git: 'https://github.com/samvera/hydra-derivatives.git', branch: 'rails-8' +gem 'hydra-works', git: 'https://github.com/samvera/hydra-works.git', branch: 'rails-8' + + gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..') gem 'jbuilder', '~> 2.5' gem 'jquery-rails' @@ -37,7 +42,7 @@ gem 'okcomputer' gem 'pg', '~> 1.3' gem 'puma' gem 'rack-mini-profiler', require: ['prepend_net_http_patch'] -gem 'rails', '6.1.7.10' +gem 'rails', '~> 8.0' gem 'riiif', '~> 2.8' gem 'rsolr', '>= 1.0', '< 3' gem 'sass-rails', '~> 6.0' diff --git a/.koppie/Gemfile b/.koppie/Gemfile index 2b7e264a90..8b75374e89 100644 --- a/.koppie/Gemfile +++ b/.koppie/Gemfile @@ -29,6 +29,10 @@ if RUBY_PLATFORM =~ /musl/ end gem 'hydra-role-management' +gem 'hydra-editor', git: 'https://github.com/samvera/hydra-editor.git', branch: 'rails-8' +gem 'hydra-derivatives', git: 'https://github.com/samvera/hydra-derivatives.git', branch: 'rails-8' +gem 'hydra-works', git: 'https://github.com/samvera/hydra-works.git', branch: 'rails-8' + gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..') gem 'jbuilder', '~> 2.5' gem 'jquery-rails' @@ -36,7 +40,7 @@ gem 'okcomputer' gem 'pg', '~> 1.3' gem 'puma' gem 'rack-mini-profiler', require: ['prepend_net_http_patch'] -gem 'rails', '~> 7.2', '< 8.0' +gem 'rails', '~> 8.0' gem 'riiif', '~> 2.8' gem 'rsolr', '>= 1.0', '< 3' gem 'sass-rails', '~> 6.0' diff --git a/.koppie/db/schema.rb b/.koppie/db/schema.rb index f2343b3dcf..1482b5fe25 100644 --- a/.koppie/db/schema.rb +++ b/.koppie/db/schema.rb @@ -10,9 +10,9 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2024_06_06_205216) do +ActiveRecord::Schema[8.0].define(version: 2024_06_06_205216) do # These are extensions that must be enabled in order to support this database - enable_extension "plpgsql" + enable_extension "pg_catalog.plpgsql" enable_extension "uuid-ossp" create_table "bookmarks", id: :serial, force: :cascade do |t| diff --git a/hyrax.gemspec b/hyrax.gemspec index 371b15f55a..9eb4384238 100644 --- a/hyrax.gemspec +++ b/hyrax.gemspec @@ -32,7 +32,7 @@ SUMMARY # NOTE: rails does not follow sem-ver conventions, it's # minor version releases can include breaking changes; see # http://guides.rubyonrails.org/maintenance_policy.html - spec.add_dependency 'rails', '> 6.1', '< 8.0' + spec.add_dependency 'rails', '~> 8.0' spec.add_dependency 'active-fedora', '~> 15.0' spec.add_dependency 'almond-rails', '~> 0.1' @@ -86,7 +86,7 @@ SUMMARY spec.add_dependency 'signet' spec.add_dependency 'tinymce-rails', '~> 5.10' spec.add_dependency 'valkyrie', '~> 3.5' - spec.add_dependency 'view_component', '~> 2.74.1' # Pin until blacklight is updated with workaround for https://github.com/ViewComponent/view_component/issues/1565 + spec.add_dependency 'view_component' spec.add_dependency 'sprockets', '3.7.2' # 3.7.3 fails feature specs spec.add_dependency 'sass-rails', '~> 6.0' spec.add_dependency 'select2-rails', '~> 3.5' From 4f12f0bd547fb5499d586e5106b751c2571c0b00 Mon Sep 17 00:00:00 2001 From: Randall Floyd Date: Tue, 7 Oct 2025 18:03:05 -0400 Subject: [PATCH 2/5] Avoiding invalid catalog routes that now raise errors in Rails 8 --- .dassie/config/routes.rb | 2 +- .koppie/config/routes.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.dassie/config/routes.rb b/.dassie/config/routes.rb index a971d8189a..b27e96997e 100644 --- a/.dassie/config/routes.rb +++ b/.dassie/config/routes.rb @@ -9,7 +9,7 @@ concern :searchable, Blacklight::Routes::Searchable.new - resource :catalog, only: [:index], as: 'catalog', path: '/catalog', controller: 'catalog' do + resource :catalog, only: [:show], as: 'catalog', path: '/catalog', controller: 'catalog' do concerns :searchable end devise_for :users diff --git a/.koppie/config/routes.rb b/.koppie/config/routes.rb index 71a170e350..8719ce7755 100644 --- a/.koppie/config/routes.rb +++ b/.koppie/config/routes.rb @@ -8,7 +8,7 @@ concern :searchable, Blacklight::Routes::Searchable.new - resource :catalog, only: [:index], as: 'catalog', path: '/catalog', controller: 'catalog' do + resource :catalog, only: [:show], as: 'catalog', path: '/catalog', controller: 'catalog' do concerns :searchable end devise_for :users From bcbfbe2c091a884cb421f31ebd0c8ac7c91d44c3 Mon Sep 17 00:00:00 2001 From: Randall Floyd Date: Tue, 7 Oct 2025 18:04:55 -0400 Subject: [PATCH 3/5] Changing enum in models due to Rails 8 signature changes --- app/models/hyrax/operation.rb | 5 ++--- app/models/hyrax/permission_template_access.rb | 5 ++--- app/models/proxy_deposit_request.rb | 5 ++--- app/models/sipity/notification.rb | 2 +- app/models/sipity/notification_recipient.rb | 5 ++--- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/app/models/hyrax/operation.rb b/app/models/hyrax/operation.rb index f66def7cbd..f57618012a 100644 --- a/app/models/hyrax/operation.rb +++ b/app/models/hyrax/operation.rb @@ -7,14 +7,13 @@ class Operation < ActiveRecord::Base FAILURE = 'failure' SUCCESS = 'success' - enum( - status: { + enum :status, + { FAILURE => FAILURE, PENDING => PENDING, PERFORMING => PERFORMING, SUCCESS => SUCCESS } - ) self.table_name = 'curation_concerns_operations' acts_as_nested_set diff --git a/app/models/hyrax/permission_template_access.rb b/app/models/hyrax/permission_template_access.rb index 8522d74da2..afbd53e5bc 100644 --- a/app/models/hyrax/permission_template_access.rb +++ b/app/models/hyrax/permission_template_access.rb @@ -18,13 +18,12 @@ class PermissionTemplateAccess < ActiveRecord::Base GROUP = 'group' USER = 'user' - enum( - access: { + enum :access, + { VIEW => VIEW, DEPOSIT => DEPOSIT, MANAGE => MANAGE } - ) # @api public # diff --git a/app/models/proxy_deposit_request.rb b/app/models/proxy_deposit_request.rb index 1cc1bf4cd2..4b419e1ea0 100644 --- a/app/models/proxy_deposit_request.rb +++ b/app/models/proxy_deposit_request.rb @@ -118,14 +118,13 @@ def send_request_transfer_message_as_part_of_update CANCELED = 'canceled' REJECTED = 'rejected' - enum( - status: { + enum :status, + { ACCEPTED => ACCEPTED, CANCELED => CANCELED, PENDING => PENDING, REJECTED => REJECTED } - ) # @param [TrueClass,FalseClass] reset (false) if true, reset the access controls. This revokes edit access from the depositor def transfer!(reset = false) diff --git a/app/models/sipity/notification.rb b/app/models/sipity/notification.rb index bb8629babf..fb46799340 100644 --- a/app/models/sipity/notification.rb +++ b/app/models/sipity/notification.rb @@ -18,7 +18,7 @@ class Notification < ActiveRecord::Base NOTIFICATION_TYPE_EMAIL = 'email' # TODO: There are other types, but for now, we are assuming just emails to send. - enum(notification_type: { NOTIFICATION_TYPE_EMAIL => NOTIFICATION_TYPE_EMAIL }) + enum :notification_type, { NOTIFICATION_TYPE_EMAIL => NOTIFICATION_TYPE_EMAIL } def self.valid_notification_types notification_types.keys diff --git a/app/models/sipity/notification_recipient.rb b/app/models/sipity/notification_recipient.rb index d5f237274e..aa9fc06d7f 100644 --- a/app/models/sipity/notification_recipient.rb +++ b/app/models/sipity/notification_recipient.rb @@ -7,12 +7,11 @@ class NotificationRecipient < ActiveRecord::Base belongs_to :notification, class_name: 'Sipity::Notification' belongs_to :role, class_name: 'Sipity::Role' - enum( - recipient_strategy: { + enum :recipient_strategy, + { 'to' => 'to', 'cc' => 'cc', 'bcc' => 'bcc' } - ) end end From 2f226fa49006f0bdaaf95d8f0ffb752723845e00 Mon Sep 17 00:00:00 2001 From: Randall Floyd Date: Wed, 8 Oct 2025 17:35:42 -0400 Subject: [PATCH 4/5] more gemspec changes for Rails 8 --- .dassie/Gemfile | 2 +- .koppie/Gemfile | 1 + Gemfile | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.dassie/Gemfile b/.dassie/Gemfile index efc1e7b8c0..ddd0a0d9c5 100644 --- a/.dassie/Gemfile +++ b/.dassie/Gemfile @@ -33,7 +33,7 @@ gem 'hydra-role-management' gem 'hydra-editor', git: 'https://github.com/samvera/hydra-editor.git', branch: 'rails-8' gem 'hydra-derivatives', git: 'https://github.com/samvera/hydra-derivatives.git', branch: 'rails-8' gem 'hydra-works', git: 'https://github.com/samvera/hydra-works.git', branch: 'rails-8' - +gem 'active-fedora', git: 'https://github.com/samvera/active_fedora.git', branch: 'main' gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..') gem 'jbuilder', '~> 2.5' diff --git a/.koppie/Gemfile b/.koppie/Gemfile index 8b75374e89..9d1aac2283 100644 --- a/.koppie/Gemfile +++ b/.koppie/Gemfile @@ -32,6 +32,7 @@ gem 'hydra-role-management' gem 'hydra-editor', git: 'https://github.com/samvera/hydra-editor.git', branch: 'rails-8' gem 'hydra-derivatives', git: 'https://github.com/samvera/hydra-derivatives.git', branch: 'rails-8' gem 'hydra-works', git: 'https://github.com/samvera/hydra-works.git', branch: 'rails-8' +gem 'active-fedora', git: 'https://github.com/samvera/active_fedora.git', branch: 'main' gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..') gem 'jbuilder', '~> 2.5' diff --git a/Gemfile b/Gemfile index 5023f2915b..2301a7aef3 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,11 @@ else gemspec end +gem 'active-fedora', git: 'https://github.com/samvera/active_fedora.git', branch: 'main' +gem 'hydra-derivatives', git: 'https://github.com/samvera/hydra-derivatives.git', branch: 'rails-8' +gem 'hydra-editor', git: 'https://github.com/samvera/hydra-editor.git', branch: 'rails-8' +gem 'hydra-works', git: 'https://github.com/samvera/hydra-works.git', branch: 'rails-8' + group :development, :test do gem 'benchmark-ips' gem 'easy_translate' From 0eca704aefa95c4ce6d402e131458f0daff3e1a0 Mon Sep 17 00:00:00 2001 From: Randall Floyd Date: Wed, 3 Dec 2025 15:37:06 -0500 Subject: [PATCH 5/5] Use core component gems with Rails 8 support --- .dassie/Gemfile | 3 --- .koppie/Gemfile | 3 --- Gemfile | 3 --- 3 files changed, 9 deletions(-) diff --git a/.dassie/Gemfile b/.dassie/Gemfile index ddd0a0d9c5..25a441e4ca 100644 --- a/.dassie/Gemfile +++ b/.dassie/Gemfile @@ -30,9 +30,6 @@ if RUBY_PLATFORM =~ /musl/ end gem 'hydra-role-management' -gem 'hydra-editor', git: 'https://github.com/samvera/hydra-editor.git', branch: 'rails-8' -gem 'hydra-derivatives', git: 'https://github.com/samvera/hydra-derivatives.git', branch: 'rails-8' -gem 'hydra-works', git: 'https://github.com/samvera/hydra-works.git', branch: 'rails-8' gem 'active-fedora', git: 'https://github.com/samvera/active_fedora.git', branch: 'main' gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..') diff --git a/.koppie/Gemfile b/.koppie/Gemfile index 9d1aac2283..81da6e524b 100644 --- a/.koppie/Gemfile +++ b/.koppie/Gemfile @@ -29,9 +29,6 @@ if RUBY_PLATFORM =~ /musl/ end gem 'hydra-role-management' -gem 'hydra-editor', git: 'https://github.com/samvera/hydra-editor.git', branch: 'rails-8' -gem 'hydra-derivatives', git: 'https://github.com/samvera/hydra-derivatives.git', branch: 'rails-8' -gem 'hydra-works', git: 'https://github.com/samvera/hydra-works.git', branch: 'rails-8' gem 'active-fedora', git: 'https://github.com/samvera/active_fedora.git', branch: 'main' gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..') diff --git a/Gemfile b/Gemfile index 2301a7aef3..2a572cec29 100644 --- a/Gemfile +++ b/Gemfile @@ -11,9 +11,6 @@ else end gem 'active-fedora', git: 'https://github.com/samvera/active_fedora.git', branch: 'main' -gem 'hydra-derivatives', git: 'https://github.com/samvera/hydra-derivatives.git', branch: 'rails-8' -gem 'hydra-editor', git: 'https://github.com/samvera/hydra-editor.git', branch: 'rails-8' -gem 'hydra-works', git: 'https://github.com/samvera/hydra-works.git', branch: 'rails-8' group :development, :test do gem 'benchmark-ips'