Sha256: d7bfb43c4ba4e81fee1da8ef66bbd931c24226594051344e3869c6ea0cb902e8
Contents?: true
Size: 731 Bytes
Versions: 55
Compression:
Stored size: 731 Bytes
Contents
module ThinkFeelDoEngine module Coach # Provides helpers for transforming patient data for the viz module MoodsAndPhqVizHelper def emotional_ratings(participant) ratings = {} participant.emotional_ratings.order(:created_at).each do |rating| unless ratings[rating.name.to_sym] ratings[rating.name.to_sym] = [] end ratings[rating.name.to_sym] << [rating.created_at.to_i, rating.rating] end ratings.keys.map { |key| [key.to_sym, ratings[key.to_sym]] } end def mood_ratings(participant) participant.moods.order(:created_at).map do |mood| [mood.created_at.to_i, mood.rating] end end end end end
Version data entries
55 entries across 55 versions & 1 rubygems