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

refactor: clean up decorator context creation #646

Merged
merged 1 commit into from
Nov 26, 2023

Conversation

bethesque
Copy link
Member

The original purpose of the DecoratorContext was to provide the decorators with an object that could be used as the user_options for getting things like the base URL, resource URL, resource title etc.

Unfortunately, this never panned out, as the Roar::Decorator code calls merge on the user_options object (expecting it, quite reasonably, to be a Hash), and it turns back into a Hash by the time it gets yielded into the decorator blocks.

This PR cleans up and documents that code.

@bethesque bethesque requested a review from vwong November 24, 2023 22:16
@bethesque
Copy link
Member Author

cc: @tuan-pham

@bethesque bethesque merged commit add6b29 into master Nov 26, 2023
17 checks passed
@bethesque bethesque deleted the chore/clean-up-decorator-context-2 branch November 26, 2023 23:17
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.

2 participants