Sha256: 8be5d87cdac38a5bad4d63a024d4f2c58857b891ec4b0f9b4ec5620fcca8811a

Contents?: true

Size: 772 Bytes

Versions: 7

Compression:

Stored size: 772 Bytes

Contents

# frozen_string_literal: true
module ThinkFeelDoEngine
  module Reports
    # Collect metadata for all Participant Emotional Ratings.
    class EmotionalRating
      def self.columns
        %w( participant_id name rating created_at is_positive )
      end

      def self.all
        Participant.not_moderator.select(:id, :study_id).map do |participant|
          participant.emotional_ratings.map do |emotional_rating|
            {
              participant_id: participant.study_id,
              name: emotional_rating.name,
              rating: emotional_rating.rating,
              created_at: emotional_rating.created_at.iso8601,
              is_positive: emotional_rating.is_positive
            }
          end
        end.flatten
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
think_feel_do_engine-3.22.9 app/models/think_feel_do_engine/reports/emotional_rating.rb
think_feel_do_engine-3.22.8 app/models/think_feel_do_engine/reports/emotional_rating.rb
think_feel_do_engine-3.22.7 app/models/think_feel_do_engine/reports/emotional_rating.rb
think_feel_do_engine-3.22.6 app/models/think_feel_do_engine/reports/emotional_rating.rb
think_feel_do_engine-3.22.5 app/models/think_feel_do_engine/reports/emotional_rating.rb
think_feel_do_engine-3.22.4 app/models/think_feel_do_engine/reports/emotional_rating.rb
think_feel_do_engine-3.22.2 app/models/think_feel_do_engine/reports/emotional_rating.rb