Skip to content

Commit

Permalink
deprecate unused methods on NestCollectionForm
Browse files Browse the repository at this point in the history
these methods are uncalled, and are practically aliased to the query
service. drop them.
  • Loading branch information
tamsin johnson committed May 27, 2021
1 parent ced4d91 commit fa2e7ce
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 fa2e7ce

Please sign in to comment.