johnhamelink
2/24/2016 - 5:05 PM

request_to_join.rb


          if play.players.find_by_session_id(current_user.id)
            return uhoh!('Player with session ID is already on the play roster', 409)
          end

          player = play.players.new(
            session_id: current_user.id,
            origin: 'Session',
            state: Player.states[:requested_to_join],
            name: current_user.name
          )

          UpdatePlayerService.new.create(
            current_user: current_user,
            player: player
          )