Sha256: 038abb82cbb136b81d6c3fa42e3972fd9a8aeeb431c1f147b40e537606736399
Contents?: true
Size: 881 Bytes
Versions: 11
Compression:
Stored size: 881 Bytes
Contents
module SocialNetworking module Reports # Scenario: a Participant comments on a feed item. class Comment def self.columns %w( participant_id occurred_at item_type text ) end def self.all Participant.select(:id, :study_id).map do |participant| ::SocialNetworking::Comment .where(participant_id: participant.id).map do |comment| item = (comment.item.try(:item) || comment.item) next if item.nil? { participant_id: participant.study_id, occurred_at: comment.created_at.iso8601, item_type: item.class.to_s, text: comment.text } end end.flatten.compact end def self.to_csv ThinkFeelDoEngine::Reports::Reporter.new(self).write_csv end end end end
Version data entries
11 entries across 11 versions & 1 rubygems