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

[24972] Feature/hierarchy mode query #5330

Merged
merged 5 commits into from
Apr 11, 2017
Merged

Conversation

oliverguenther
Copy link
Member

@oliverguenther oliverguenther commented Apr 7, 2017

@oliverguenther oliverguenther changed the title Feature/hierarchy mode query [24972] Feature/hierarchy mode query Apr 7, 2017
@oliverguenther oliverguenther force-pushed the feature/hierarchy-mode-query branch 2 times, most recently from 58be6e8 to 21a99e9 Compare April 10, 2017 07:01
query.show_hierarchies = false
else
query.show_hierarchies = params[:show_hierarchies] if params.key?(:show_hierarchies)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with the side effect as I can see why it is necessary.

However, I'd then rather narrow down the cases when that side effect is applied. In addition, this method right now depends on the correct order of execution (only if group_by is set before calling the method, will show_hierarchies be ignored). In addition, this will prevent clients from getting an error response in a scenario where they only send show_hierarchies=true to a grouped query. The backend will currently simply discard the change.

I'd therefore rather have one method which covers both params at the same time and which only takes the params as input.

Copy link
Member Author

@oliverguenther oliverguenther Apr 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we'll need this restriction anymore and instead, we can let the user receive the full error message.

@@ -185,6 +185,8 @@ def initialize(model,

property :timeline_visible

property :show_hierarchies
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we simply use hierarchies? It is probably just my rails infected preference but I really dislike those two word properties for booleans. Same applies for timeline_visible for that matter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't find hierarchies appropriate. I could settle with hierarchyMode, since we'll likely have other modes in the future.

@oliverguenther oliverguenther force-pushed the feature/hierarchy-mode-query branch 2 times, most recently from aade38f to edd17b7 Compare April 10, 2017 18:24
@ulferts ulferts merged commit 9e09e7f into dev Apr 11, 2017
@ulferts ulferts deleted the feature/hierarchy-mode-query branch April 11, 2017 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants