Skip to content

Commit

Permalink
Deprecate ModelProxy#valid_child_concerns
Browse files Browse the repository at this point in the history
This method isn't releted to the `ModelProxy` concern. It is deprecated, with
the relevant implementation moved to `WorkShowPresenter`.
  • Loading branch information
Tom Johnson committed Jan 10, 2020
1 parent e4b4439 commit c34dc0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/presenters/hyrax/model_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions app/presenters/hyrax/work_show_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ def show_deposit_for?(collections:)
collections.present? || current_ability.can?(:create_any, ::Collection)
end

##
# @return [Array<Class>]
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
Expand Down

0 comments on commit c34dc0d

Please sign in to comment.