Skip to content

Commit

Permalink
distinguish report include and include_for_find
Browse files Browse the repository at this point in the history
includes are for columns in the query
includes_for_find are for the models used by the report views

Reports merge the two concepts. But only the miq expression (where) or
includes (select) need to be in the references. While includes_for_find
only needs to preload the models for use in ruby.

This allows each to be accessed in a report.
  • Loading branch information
kbrock committed Sep 12, 2019
1 parent df70cdf commit cd434a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/miq_report/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ def table2class(table)
end

def get_include_for_find
include_as_hash(include.presence || invent_report_includes).deep_merge(include_for_find || {}).presence
get_include.deep_merge(include_for_find || {}).presence
end

def get_include
include_as_hash(include.presence || invent_report_includes)
end

def invent_includes
Expand Down

0 comments on commit cd434a4

Please sign in to comment.