Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Remove CollectionForm#alternative_title #94

Closed
wants to merge 1 commit into from

Conversation

jeremyf
Copy link
Contributor

@jeremyf jeremyf commented Oct 17, 2023

The inline comments explain best:

As part of PR 87 we have attempted to rid the collection form of
the alternative_title (to deal with the conflicting predicate for
slugs). However, it is declared by way of
Hyrax::Forms::CollectionForm.delegate(:alternative_title, to: > :model)

Which means that we cannot rely on remove_method to tidy this up.
Instead we declare the method (thus obliterating the delegation).
We then use Ruby's undef_method which instructs the object to no
longer respond_to the undefined method. See the tests for
clarification.

Further, I've discovered that re-using a decorator that was declared in
Hyku resulted in the Knapsack decorator not working; hence the rename.

Related to:

The inline comments explain best:

> As part of [PR 87][87] we have attempted to rid the collection form of
> the alternative_title (to deal with the conflicting predicate for
> slugs).  However, it is declared by way of
> `Hyrax::Forms::CollectionForm.delegate(:alternative_title, to: > :model)`
>
> Which means that we cannot rely on `remove_method` to tidy this up.
> Instead we declare the method (thus obliterating the delegation).
> We then use Ruby's `undef_method` which instructs the object to no
> longer `respond_to` the undefined method.  See the tests for
> clarification.

Further, I've discovered that re-using a decorator that was declared in
Hyku resulted in the Knapsack decorator not working; hence the rename.

Related to:

- #87
- https://playbook-staging.notch8.com/en/samvera/custom-slugs
- https://github.com/scientist-softserv/adventist-dl/issues/620
- https://github.com/scientist-softserv/adventist-dl/issues/578

[87]: #87
@jeremyf jeremyf closed this Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant