From 12ea14bd57317fc272c87384f624bc01da5ca54f Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Mon, 27 Jun 2022 10:21:03 -0700 Subject: [PATCH] remove deprecated methods from CollectionBehavior --- .../concerns/hyrax/collection_behavior.rb | 47 ------------------- spec/factories/collections.rb | 1 + 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/app/models/concerns/hyrax/collection_behavior.rb b/app/models/concerns/hyrax/collection_behavior.rb index fda814adb8..de76c29bca 100644 --- a/app/models/concerns/hyrax/collection_behavior.rb +++ b/app/models/concerns/hyrax/collection_behavior.rb @@ -52,25 +52,6 @@ def collection_type=(new_collection_type) self.collection_type_gid = new_collection_type.to_global_id end - # Add members using the members association. - def add_members(new_member_ids) - Deprecation.warn("'##{__method__}' will be removed in Hyrax 4.0. " \ - "Instead, use Hyrax::Collections::CollectionMemberService.add_members_by_ids.") - Hyrax::Collections::CollectionMemberService.add_members_by_ids(collection_id: id, - new_member_ids: new_member_ids, - user: nil) - end - - # Add member objects by adding this collection to the objects' member_of_collection association. - # @param [Enumerable] the ids of the new child collections and works collection ids - def add_member_objects(new_member_ids) - Deprecation.warn("'##{__method__}' will be removed in Hyrax 4.0. " \ - "Instead, use Hyrax::Collections::CollectionMemberService.add_members_by_ids.") - Hyrax::Collections::CollectionMemberService.add_members_by_ids(collection_id: id, - new_member_ids: new_member_ids, - user: nil) - end - # @return [Enumerable] an enumerable over the children of this collection def member_objects ActiveFedora::Base.where("member_of_collection_ids_ssim:#{id}") @@ -96,22 +77,6 @@ def _to_partial_path # :nodoc: "hyrax/#{collection}/#{element}" end end - - def collection_type_gid_document_field_name - Deprecation.warn('use Hyrax.config.collection_type_index_field instead') - Hyrax.config.collection_type_index_field - end - end - - # @deprecated to be removed in 4.0.0; this feature was replaced with a - # hard-coded null implementation - # @return [Fixnum] 0 - def bytes - Deprecation.warn('#bytes has been deprecated for removal in Hyrax 4.0.0; ' \ - 'The implementation of the indexed Collection size ' \ - 'feature is extremely inefficient, so it has been removed. ' \ - 'This method now returns a hard-coded `0` for compatibility.') - 0 end # @api public @@ -122,18 +87,6 @@ def permission_template Hyrax::PermissionTemplate.find_by!(source_id: id) end - ## - # @deprecated use PermissionTemplate#reset_access_controls_for instead - # - # Calculate and update who should have read/edit access to the collections based on who - # has access in PermissionTemplateAccess - def reset_access_controls! - Deprecation.warn("reset_access_controls! is deprecated; use PermissionTemplate#reset_access_controls_for instead.") - - permission_template - .reset_access_controls_for(collection: self, interpret_visibility: true) - end - private # Solr field name works use to index member ids diff --git a/spec/factories/collections.rb b/spec/factories/collections.rb index f1f2e467d7..1f52c5e06d 100644 --- a/spec/factories/collections.rb +++ b/spec/factories/collections.rb @@ -99,6 +99,7 @@ after(:create) do |collection, _evaluator| collection.permission_template.reset_access_controls_for(collection: collection, interpret_visibility: true) + # Hyrax::PermissionTemplate.reset_access_controls_for(collection: collection) end factory :public_collection_lw, traits: [:public_lw]