Sha256: 67d5eab12765e0537acb036f91e0553aa51636b103db20c509675f40083b3d23

Contents?: true

Size: 468 Bytes

Versions: 4

Compression:

Stored size: 468 Bytes

Contents

module FieldTest
  class ParticipantsController < BaseController
    def show
      @participant = params[:id]
      # TODO better ordering
      @memberships = FieldTest::Membership.where(participant: @participant).order(:id)

      @events =
        if FieldTest.events_supported?
          FieldTest::Event.where(field_test_membership_id: @memberships.map(&:id)).group(:field_test_membership_id, :name).count
        else
          {}
        end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
field_test-0.2.4 app/controllers/field_test/participants_controller.rb
field_test-0.2.3 app/controllers/field_test/participants_controller.rb
field_test-0.2.2 app/controllers/field_test/participants_controller.rb
field_test-0.2.1 app/controllers/field_test/participants_controller.rb