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

Report both includes #13639

Merged
merged 3 commits into from
Jan 27, 2017
Merged

Report both includes #13639

merged 3 commits into from
Jan 27, 2017

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Jan 24, 2017

MiqReport (definitions in product/*/*.yaml) are used for our table views and reports.

In reports we define associated tables using the :includes value.
In table views, we define associated tables with both :includes and :includes_for_find.

This PR removes that distinction. So both reports and views use both fields.

https://www.pivotaltracker.com/story/show/137377249

Going forward, will be using only 1 set of includes per report.
At one time, I split these out into 2 fields to reduce sql munging,
but really no need for this change anymore
view "reports" had 2 fields: includes and includes_for_find
reports only had 1 field: includes

before:

get_include_for_find produced includes() from includes field
some code manually merged includes_for_find field

after:

renamed old get_include_for_find to include_as_hash
  It still converts the includes field into an ar includes() hash syntax
new get_include_for_find
  merges includes_for_find field (hash)

so now both reports and views use both fields.
but the nuances of includes vs include_for_field is in a single method
@miq-bot
Copy link
Member

miq-bot commented Jan 24, 2017

Checked commits kbrock/manageiq@6fb7f21~...5ff3b98 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
3 files checked, 1 offense detected

app/models/miq_report/generator.rb

Copy link
Member

@isimluk isimluk left a comment

Choose a reason for hiding this comment

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

👍

@@ -82,12 +82,10 @@ def paged_view_search(options = {})
self.display_filter = options.delete(:display_filter_hash) if options[:display_filter_hash]
self.display_filter = options.delete(:display_filter_block) if options[:display_filter_block]

includes1 = get_include_for_find(include)
includes = MiqExpression.merge_includes(includes1, include_for_find)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is basically the whole PR:

# before
includes = MiqExpression.merge_includes(get_include_for_find, include_for_find)
# after
includes = get_include_for_find

Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

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

👍 Looks good

@gtanzillo gtanzillo added this to the Sprint 53 Ending Jan 30, 2017 milestone Jan 27, 2017
@gtanzillo gtanzillo merged commit cfa975d into ManageIQ:master Jan 27, 2017
@kbrock kbrock deleted the report_both_includes branch January 27, 2017 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants