class SavedReport

File

saved_report.rb

(C)

Hipposoft 2011

Purpose

Describe and record all parameters needed to generate reports.


13-Oct-2011 (ADH): Created.

Constants

CUSTOMER_SORT_FIELD_CREATED_AT
CUSTOMER_SORT_FIELD_LIMIT
CUSTOMER_SORT_FIELD_VALUES
DEFAULT_SORT_COLUMN
DEFAULT_SORT_DIRECTION
DEFAULT_SORT_ORDER
PROJECT_SORT_FIELD_CREATED_AT
PROJECT_SORT_FIELD_LIMIT
PROJECT_SORT_FIELD_VALUES
TASK_FILTER_LIMIT
TASK_FILTER_NON_BILLABLE
TASK_FILTER_VALUES
TASK_GROUPING_BOTH
TASK_GROUPING_LIMIT
TASK_GROUPING_VALUES
TASK_SORT_FIELD_CREATED_AT
TASK_SORT_FIELD_LIMIT
TASK_SORT_FIELD_VALUES
TITLE_LIMIT

Various constants used by the “20111013142252_add_saved_reports_support.rb” migration file and various pieces of application code

USED_RANGE_COLUMN

Public Instance Methods

generate_report( flush_cache = false ) click to toggle source

Return (and cache) a TrackRecordReport::Report instance based on the attributes of this SavedReport model instance. The result is cached for later access. If you alter attribute values, pass ‘true’ on entry to force a refresh of the cache and update the TrackRecordReport::Report instance.

# File app/models/saved_report.rb, line 88
def generate_report( flush_cache = false )
  if ( @report.nil? || flush_cache )
    # The TrackRecord internal Report object can be created from this
    # instance's attributes directly, except for many-to-many relationships,
    # which are not exposed in that hash and must be assigned manually.

    @report                     = TrackRecordReport::Report.new( user, attributes() )
    @report.active_task_ids     = active_task_ids
    @report.inactive_task_ids   = inactive_task_ids
    @report.reportable_user_ids = reportable_user_ids
  end

  @report
end