Class: SpreeCmCommissioner::VotingContestants::Assigner

Inherits:
Object
  • Object
show all
Includes:
Spree::ServiceModule::Base
Defined in:
app/services/spree_cm_commissioner/voting_contestants/assigner.rb

Instance Method Summary collapse

Instance Method Details

#call(voting_session:, show_contestant_ids: []) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'app/services/spree_cm_commissioner/voting_contestants/assigner.rb', line 6

def call(voting_session:, show_contestant_ids: [])
  @voting_session = voting_session
  @episode = voting_session.episode
  @show_contestant_ids = show_contestant_ids || []

  assign_contestants

  success(voting_session: @voting_session)
rescue StandardError => e
  failure(nil, e.message)
end