Module: Ruport::Reportable

Defined in:
lib/ruport/acts_as_reportable.rb

Overview

Overview

This module is designed to allow an ActiveRecord model to be converted to Ruport’s data structures. If ActiveRecord is available when Ruport is loaded, this module will be automatically mixed into ActiveRecord::Base.

Add the acts_as_reportable call to the model class that you want to integrate with Ruport:

class Book < ActiveRecord::Base
  acts_as_reportable
  belongs_to :author
end

Then you can use the report_table method to get data from the model using ActiveRecord.

Book.report_table(:all, :include => :author)

Defined Under Namespace

Modules: ClassMethods, InstanceMethods, SingletonMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:



38
39
40
# File 'lib/ruport/acts_as_reportable.rb', line 38

def self.included(base) #:nodoc:
  base.extend ClassMethods  
end