Skip to content

Commit

Permalink
Merge pull request #4984 from samvera/deprecate-nest-collection-form
Browse files Browse the repository at this point in the history
deprecate unused methods on `NestCollectionForm`
  • Loading branch information
jeremyf authored May 27, 2021
2 parents ced4d91 + fa2e7ce commit b06fbbd
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions app/forms/hyrax/forms/dashboard/nest_collection_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,37 @@ def save
persistence_service.persist_nested_collection_for(parent: parent, child: child)
end

##
# @deprecated this method is unused by hyrax, and is effectively a
# delegation to `Hyrax::Collections::NestedCollectionQueryService`.
# if you want to be sure to use nested indexing to generate this list,
# use the query service directly.
#
# For the given parent, what are all of the available collections that
# can be added as sub-collection of the parent.
def available_child_collections
Deprecation.warn "#{self.class}#available_child_collections " \
"is deprecated. the helper of the same name or " \
"Hyrax::Collections::NestedCollectionQueryService " \
"instead."

query_service.available_child_collections(parent: parent, scope: context)
end

##
# @deprecated this method is unused by hyrax, and is effectively a
# delegation to `Hyrax::Collections::NestedCollectionQueryService`.
# if you want to be sure to use nested indexing to generate this list,
# use the query service directly.
#
# For the given child, what are all of the available collections to
# which the child can be added as a sub-collection.
def available_parent_collections
Deprecation.warn "#{self.class}#available_parent_collections " \
"is deprecated. the helper of the same name or " \
"Hyrax::Collections::NestedCollectionQueryService " \
"instead."

query_service.available_parent_collections(child: child, scope: context)
end

Expand Down

0 comments on commit b06fbbd

Please sign in to comment.