Sha256: f9efe7abb15587bac9678b391025c9d911ec8f2782c9196a4ad03738571431f2

Contents?: true

Size: 671 Bytes

Versions: 1

Compression:

Stored size: 671 Bytes

Contents

class Mg::ReportItem < ActiveRecord::Base
  self.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

1 entries across 1 versions & 1 rubygems

Version Path
mountain-goat-1.0.6pre1 lib/mountain-goat/models/mg/report_item.rb