Skip to content

Commit

Permalink
expose the human expression and based_on
Browse files Browse the repository at this point in the history
  • Loading branch information
Jillian Tullo committed Apr 20, 2017
1 parent 8ba23bf commit 03b5dac
Showing 1 changed file with 11 additions and 0 deletions.
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

0 comments on commit 03b5dac

Please sign in to comment.