Sha256: 56b8a2dfb9b6ddec74a476fb7d3e574635781cfbf091d864c7db2c433d2ce785

Contents?: true

Size: 753 Bytes

Versions: 14

Compression:

Stored size: 753 Bytes

Contents

module FieldTest
  class ParticipantsController < BaseController
    def show
      # TODO better ordering
      @memberships =
        if FieldTest.legacy_participants
          @participant = params[:id]
          FieldTest::Membership.where(participant: @participant).order(:id)
        else
          id = params[:id]
          type = params[:type]
          @participant = [type, id].compact.join(" ")
          FieldTest::Membership.where(participant_type: type, participant_id: id).order(:id)
        end

      @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

14 entries across 14 versions & 1 rubygems

Version Path
field_test-0.7.0 app/controllers/field_test/participants_controller.rb
field_test-0.6.1 app/controllers/field_test/participants_controller.rb
field_test-0.6.0 app/controllers/field_test/participants_controller.rb
field_test-0.5.5 app/controllers/field_test/participants_controller.rb
field_test-0.5.4 app/controllers/field_test/participants_controller.rb
field_test-0.5.3 app/controllers/field_test/participants_controller.rb
field_test-0.5.2 app/controllers/field_test/participants_controller.rb
field_test-0.5.1 app/controllers/field_test/participants_controller.rb
field_test-0.5.0 app/controllers/field_test/participants_controller.rb
field_test-0.4.1 app/controllers/field_test/participants_controller.rb
field_test-0.4.0 app/controllers/field_test/participants_controller.rb
field_test-0.3.2 app/controllers/field_test/participants_controller.rb
field_test-0.3.1 app/controllers/field_test/participants_controller.rb
field_test-0.3.0 app/controllers/field_test/participants_controller.rb