From c34dc0d7811fc4858995dc3ade84bac3f265ef26 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Fri, 10 Jan 2020 13:48:02 -0800 Subject: [PATCH] Deprecate `ModelProxy#valid_child_concerns` This method isn't releted to the `ModelProxy` concern. It is deprecated, with the relevant implementation moved to `WorkShowPresenter`. --- app/presenters/hyrax/model_proxy.rb | 4 ++++ app/presenters/hyrax/work_show_presenter.rb | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/app/presenters/hyrax/model_proxy.rb b/app/presenters/hyrax/model_proxy.rb index 0d1d6c154a..88a17ba0c7 100644 --- a/app/presenters/hyrax/model_proxy.rb +++ b/app/presenters/hyrax/model_proxy.rb @@ -18,7 +18,11 @@ def to_model self end + ## + # @deprecated this isn't related to the ModelProxy issue, and has been moved + # to `WorkShowPresenter`. def valid_child_concerns + Deprecation.warn "#{self.class}#valid_child_concerns will be removed in Hyrax 4.0." Hyrax::ChildTypes.for(parent: solr_document.hydra_model) end diff --git a/app/presenters/hyrax/work_show_presenter.rb b/app/presenters/hyrax/work_show_presenter.rb index 3d1a4d5436..b11e78ca7d 100644 --- a/app/presenters/hyrax/work_show_presenter.rb +++ b/app/presenters/hyrax/work_show_presenter.rb @@ -231,6 +231,12 @@ def show_deposit_for?(collections:) collections.present? || current_ability.can?(:create_any, ::Collection) end + ## + # @return [Array] + def valid_child_concerns + Hyrax::ChildTypes.for(parent: solr_document.hydra_model).to_a + end + private # list of item ids to display is based on ordered_ids