Sha256: db9e473fe6c94c08aa7d41f6054e15562f9907953fded16d25d40eba1ebf6979

Contents?: true

Size: 667 Bytes

Versions: 5

Compression:

Stored size: 667 Bytes

Contents

class Mg::ReportItem < ActiveRecord::Base
  set_table_name :mg_report_items
  
  belongs_to :mg_report, :class_name => "Mg::Report", :foreign_key => "mg_report_id"
  belongs_to :reportable, :polymorphic => true
  belongs_to :pivot, :polymorphic => true
  
  validates_presence_of :mg_report_id
  validates_presence_of :reportable_id
  validates_presence_of :reportable_type
  validates_presence_of :order
  
  def chart_title
    return self.reportable.reportable_title(pivot)
  end
  
  def chart_items
    return self.reportable.reportable_chart_items(self.pivot)
  end
  
  def gerbil_chart
    return self.reportable.reportable_gerbil_chart(self.pivot)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mountain-goat-1.0.5 lib/mountain-goat/models/mg/report_item.rb
mountain-goat-1.0.4 lib/mountain-goat/models/mg/report_item.rb
mountain-goat-1.0.3 lib/mountain-goat/models/mg/report_item.rb
mountain-goat-1.0.2 lib/mountain-goat/models/mg/report_item.rb
mountain-goat-1.0.1 lib/mountain-goat/models/mg/report_item.rb