From c65ba6c20193a8a69a827079b720b179d20f6172 Mon Sep 17 00:00:00 2001 From: Daniel Pierce Date: Wed, 21 Feb 2024 17:08:43 -0500 Subject: [PATCH] Set valkyrie models as default in Hyrax.config file_set_model is already the valkyrie model by default. .dassie continues to use the AF models. Existing hyrax applications continuing to use AF will need to set a similar config. --- .dassie/config/initializers/hyrax.rb | 5 +++++ lib/hyrax/configuration.rb | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.dassie/config/initializers/hyrax.rb b/.dassie/config/initializers/hyrax.rb index 5b235fbab7..c23ab77b8f 100644 --- a/.dassie/config/initializers/hyrax.rb +++ b/.dassie/config/initializers/hyrax.rb @@ -63,6 +63,11 @@ # config.collection_model = 'Hyrax::PcdmCollection' # collection without basic metadata # config.collection_model = 'CollectionResource' # collection with basic metadata # config.admin_set_model = 'Hyrax::AdministrativeSet' + + # dassie needs legacy AF models + config.collection_model = '::Collection' + config.admin_set_model = 'AdminSet' + config.file_set_model = '::FileSet' end Date::DATE_FORMATS[:standard] = "%m/%d/%Y" diff --git a/lib/hyrax/configuration.rb b/lib/hyrax/configuration.rb index c3b372b79d..2c2a6cc318 100644 --- a/lib/hyrax/configuration.rb +++ b/lib/hyrax/configuration.rb @@ -55,7 +55,7 @@ module Hyrax # # == Valkyrie # - # *Experimental:* Options for toggling Hyrax's experimental "Wings" valkyrie + # Options for toggling Hyrax's "Wings" valkyrie # adapter and configuring valkyrie. # # @see Hyrax.config @@ -617,14 +617,14 @@ def index_adapter=(adapter) end ## - # @return [Boolean] whether to use the experimental valkyrie index + # @return [Boolean] whether to use the valkyrie index def query_index_from_valkyrie @query_index_from_valkyrie ||= false end attr_writer :query_index_from_valkyrie ## - # @return [Boolean] whether to use experimental valkyrie storage features + # @return [Boolean] whether to use valkyrie storage features def use_valkyrie? return @use_valkyrie unless @use_valkyrie.nil? return true if disable_wings # always return true if wings is disabled @@ -860,7 +860,7 @@ def collection_type_index_field # @return [#constantize] a string representation of the collection # model def collection_model - @collection_model ||= '::Collection' + @collection_model ||= 'Hyrax::PcdmCollection' end ## @@ -874,7 +874,7 @@ def collection_class # @return [#constantize] a string representation of the admin set # model def admin_set_model - @admin_set_model ||= 'AdminSet' + @admin_set_model ||= 'Hyrax::AdministrativeSet' end ##