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 attributes for SUI #14829

Merged
merged 1 commit into from
Apr 25, 2017
Merged
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
11 changes: 11 additions & 0 deletions app/models/miq_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down