From 03b5dacb4480219b6e51f1ace87baf809965981b Mon Sep 17 00:00:00 2001 From: Jillian Tullo Date: Thu, 20 Apr 2017 15:04:27 -0400 Subject: [PATCH] expose the human expression and based_on --- app/models/miq_report.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/models/miq_report.rb b/app/models/miq_report.rb index 9a61bb26dfa..45518dc69d9 100644 --- a/app/models/miq_report.rb +++ b/app/models/miq_report.rb @@ -40,6 +40,9 @@ class MiqReport < ApplicationRecord belongs_to :user has_many :miq_widgets, :as => :resource + virtual_column :human_expression, :type => :string + virtual_column :based_on, :type => :string + alias_attribute :menu_name, :name attr_accessor_that_yamls :table, :sub_table, :filter_summary, :extras, :ids, :scoped_association, :html_title, :file_name, :extras, :record_id, :tl_times, :user_categories, :trend_data, :performance, :include_for_find, @@ -89,6 +92,14 @@ def cols self[:cols] ||= (self[:col_order] || []).reject { |x| x.include?(".") } end + def human_expression + conditions.to_human + end + + def based_on + Dictionary.gettext(db, :type => :model, :notfound => :titleize) + end + def view_filter_columns col_order.collect { |c| [headers[col_order.index(c)], c] } end