Sha256: 8d6a7dbbe95f3a6f3bf9e0cb2c79db913bd88605e538176c154c9f46d42b08cf

Contents?: true

Size: 744 Bytes

Versions: 11

Compression:

Stored size: 744 Bytes

Contents

module SocialNetworking
  module Reports
    # Scenario: a Participant nudges another Participant.
    class Nudge
      def self.columns
        %w( participant_id occurred_at recipient_id )
      end

      def self.all
        Participant.select(:id, :study_id).map do |participant|
          ::SocialNetworking::Nudge
            .where(initiator_id: participant.id).map do |nudge|
              {
                participant_id: participant.study_id,
                occurred_at: nudge.created_at.iso8601,
                recipient_id: nudge.recipient.study_id
              }
            end
        end.flatten
      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

Version Path
social_networking-0.11.8 app/models/social_networking/reports/nudge.rb
social_networking-0.11.7 app/models/social_networking/reports/nudge.rb
social_networking-0.11.6 app/models/social_networking/reports/nudge.rb
social_networking-0.11.5 app/models/social_networking/reports/nudge.rb
social_networking-0.11.4 app/models/social_networking/reports/nudge.rb
social_networking-0.11.3 app/models/social_networking/reports/nudge.rb
social_networking-0.11.2 app/models/social_networking/reports/nudge.rb
social_networking-0.11.1 app/models/social_networking/reports/nudge.rb
social_networking-0.11.0 app/models/social_networking/reports/nudge.rb
social_networking-0.10.0 app/models/social_networking/reports/nudge.rb
social_networking-0.9.3 app/models/social_networking/reports/nudge.rb