Class: ThinkFeelDoEngine::Reports::PatientActivity

Inherits:
Object
  • Object
show all
Defined in:
app/models/think_feel_do_engine/reports/patient_activity.rb

Overview

Collect metadata for each Participant Activity.

Class Method Summary collapse

Class Method Details

.allObject



9
10
11
12
13
14
15
16
17
18
19
# File 'app/models/think_feel_do_engine/reports/patient_activity.rb', line 9

def self.all
  Participant.select(:id, :study_id).map do |participant|
    participant.activities.map do |activity|
      {
        participant_id: participant.study_id,
        activity_title: activity.title,
        created_at: activity.created_at.iso8601
      }
    end
  end.flatten
end

.columnsObject



5
6
7
# File 'app/models/think_feel_do_engine/reports/patient_activity.rb', line 5

def self.columns
  %w( participant_id activity_title created_at )
end