Class: ThinkFeelDoEngine::Reports::MoodRating
- Inherits:
-
Object
- Object
- ThinkFeelDoEngine::Reports::MoodRating
- Defined in:
- app/models/think_feel_do_engine/reports/mood_rating.rb
Overview
Collect metadata for all Participant Mood Ratings.
Class Method Summary collapse
Class Method Details
.all ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/models/think_feel_do_engine/reports/mood_rating.rb', line 10 def self.all Participant.not_moderator.select(:id, :study_id).map do |participant| participant.moods.map do |mood| { participant_id: participant.study_id, rating: mood., created_at: mood.created_at.iso8601 } end end.flatten end |
.columns ⇒ Object
6 7 8 |
# File 'app/models/think_feel_do_engine/reports/mood_rating.rb', line 6 def self.columns %w( participant_id rating created_at ) end |