Skip to content

Commit

Permalink
Merge pull request #18936 from kbrock/no_mo_turbo
Browse files Browse the repository at this point in the history
default inline_sql_views (aka turbo button) off
  • Loading branch information
bdunne authored Jul 3, 2019
2 parents 9da3a10 + 39e25c4 commit ff9564a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/models/miq_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ def filter_result_set(result_set, options)
[result_set_filtered, result_set_filtered.count]
end

def self.default_use_sql_view
false
end

private

def va_sql_cols
Expand Down
6 changes: 5 additions & 1 deletion app/models/miq_report/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,11 @@ def generate_basic_results(options = {})

## add in virtual attributes that can be calculated from sql
rbac_opts[:extra_cols] = va_sql_cols unless va_sql_cols.blank?
rbac_opts[:use_sql_view] = db_options.nil? || db_options.fetch(:use_sql_view) { true }
rbac_opts[:use_sql_view] = if db_options.nil? || db_options[:use_sql_view].nil?
MiqReport.default_use_sql_view
else
db_options[:use_sql_view]
end

results, attrs = Rbac.search(rbac_opts)
results = Metric::Helper.remove_duplicate_timestamps(results)
Expand Down
6 changes: 5 additions & 1 deletion app/models/miq_report/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ def paged_view_search(options = {})
)
search_options.merge!(:limit => limit, :offset => offset, :order => order) if order
search_options[:extra_cols] = va_sql_cols if va_sql_cols.present?
search_options[:use_sql_view] = db_options.nil? || db_options.fetch(:use_sql_view) { true }
search_options[:use_sql_view] = if db_options.nil? || db_options[:use_sql_view].nil?
MiqReport.default_use_sql_view
else
db_options[:use_sql_view]
end

if options[:parent]
targets = get_parent_targets(options[:parent], options[:association] || options[:parent_method])
Expand Down

0 comments on commit ff9564a

Please sign in to comment.