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

default inline_sql_views (aka turbo button) off #18936

Merged
merged 1 commit into from
Jul 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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?
bdunne marked this conversation as resolved.
Show resolved Hide resolved
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