Class: Spree::Api::V2::Tenant::ShowEliminationSessionsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/api/v2/tenant/show_elimination_sessions_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#current_vendor, #render_serialized_payload, #require_tenant

Instance Method Details

#collectionObject

override



7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/spree/api/v2/tenant/show_elimination_sessions_controller.rb', line 7

def collection
  @collection ||= scope
                  .includes(
                    :episode,
                    :show,
                    eliminated_voting_contestants: [
                      :show_contestant,
                      { show_contestant: %i[show_contestant_images show_contestant_videos] }
                    ]
                  )
                  .order('cm_voting_sessions.closes_at DESC')
end

#collection_serializerObject

override



21
22
23
# File 'app/controllers/spree/api/v2/tenant/show_elimination_sessions_controller.rb', line 21

def collection_serializer
  Spree::V2::Tenant::VotingSessionSerializer
end