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

Extract getTags to own method #119

Open
wants to merge 2 commits into
base: 2.x
Choose a base branch
from

Conversation

pbowyer
Copy link

@pbowyer pbowyer commented Aug 20, 2018

I recently had need to get the tags attached to resources, to output in XML and JSON. I did not find a way to get the raw results from the snippet, so wrote my own database query.

This small refactoring extracts the queries into a method, so they can be called on their own and the raw tag objects returned.

There is a design flaw: the count/total values are tightly coupled to the query, and I have retained them inside the method. This required a new object to be returned, rather than the raw TaggerTag iterator which I was aiming for. Right now, I have no better alternative.

…urn signature that I want from getTags(), but not clear how to beter return everything from the two queries.

Two separate methods would be better, but there is overlap and the two are tied together. Propose and see how others want to refactor.
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