diff --git a/app/models/hyrax/collection_type.rb b/app/models/hyrax/collection_type.rb index f8111c4830..98c3da30f3 100644 --- a/app/models/hyrax/collection_type.rb +++ b/app/models/hyrax/collection_type.rb @@ -36,14 +36,6 @@ def title=(value) assign_machine_id end - # this class attribute is deprecated in favor of {.settings_attributes} - # these need to carefully align with boolean flag attributes/table columns, - # so making it settable is a liability. deprecating is challenging because - # +class_attribute+ calls +singleton_class.class_eval { redefine_method }+ - # as the +name=+ implementation. there should be few callers outside hyrax. - class_attribute :collection_type_settings_methods, instance_writer: false - self.collection_type_settings_methods = SETTINGS_ATTRIBUTES - # These are provided as a convenience method based on prior design discussions. alias_attribute :discovery, :discoverable alias_attribute :sharing, :sharable @@ -123,14 +115,6 @@ def collections(use_valkyrie: Hyrax.config.use_valkyrie?) ActiveFedora::Base.where(Hyrax.config.collection_type_index_field.to_sym => to_global_id.to_s) end - ## - # @deprecated Use #collections.any? instead - # - # @return [Boolean] True if there is at least one collection of this type - def collections? - Deprecation.warn('Use #collections.any? instead.') && collections.any? - end - # @return [Boolean] True if this is the Admin Set type def admin_set? machine_id == ADMIN_SET_MACHINE_ID diff --git a/spec/features/collection_type_spec.rb b/spec/features/collection_type_spec.rb index c8c9f4181e..8d45dfe1b2 100644 --- a/spec/features/collection_type_spec.rb +++ b/spec/features/collection_type_spec.rb @@ -303,7 +303,7 @@ end it 'all settings are disabled', :js do - expect(exhibit_collection_type.collections?).to be true + expect(exhibit_collection_type.collections.any?).to be true click_link('Settings', href: '#settings') diff --git a/spec/models/hyrax/collection_type_spec.rb b/spec/models/hyrax/collection_type_spec.rb index 132fe036d9..e2995d6689 100644 --- a/spec/models/hyrax/collection_type_spec.rb +++ b/spec/models/hyrax/collection_type_spec.rb @@ -7,20 +7,6 @@ let!(:collection) { FactoryBot.valkyrie_create(:hyrax_collection, collection_type_gid: collection_type.to_global_id.to_s) } end - describe '.collection_type_settings_methods' do - it 'lists collection settings methods' do # deprecated - expect(described_class.collection_type_settings_methods) - .to include(:nestable?, :discoverable?, :brandable?) - end - end - - describe '#collection_type_settings_methods' do - it 'lists collection settings methods' do # deprecated - expect(collection_type.collection_type_settings_methods) - .to include(:nestable?, :discoverable?, :brandable?) - end - end - describe '.settings_attributes' do it 'lists collection settings methods' do expect(described_class.settings_attributes) @@ -203,7 +189,7 @@ end end - describe "collections?", :clean_repo do + describe "collections.any?", :clean_repo do let(:collection_type) { FactoryBot.create(:collection_type) } it 'returns true if there are any collections of this collection type' do diff --git a/spec/support/matchers/collection_type_property_matchers.rb b/spec/support/matchers/collection_type_property_matchers.rb index 0df1c18054..ad1d357e9b 100644 --- a/spec/support/matchers/collection_type_property_matchers.rb +++ b/spec/support/matchers/collection_type_property_matchers.rb @@ -25,6 +25,6 @@ RSpec::Matchers.define :have_collections do match do |actual| - actual&.collections? + actual&.collections&.any? end end