app/controllers/game_passings_controller.rb
# TODO: must be a critical section, double creation is possible!
must be a critical section, double creation is possible!
must be a critical section double creation is possible!
def find_or_create_game_passing
    @game_passing = GamePassing.of(@team, @game)
    if @game_passing.nil?
      result = GamePassingInteractors::CreatePassing.call :team => @team,
                                  :game => @game
      @game_passing = result.game_passing if result.success?
    end
  end
def find_or_create_game_passing @game_passing = GamePassing . of ( @team , @game ) if @game_passing . nil? result = GamePassingInteractors :: CreatePassing . call :team => @team , :game => @game @game_passing = result . game_passing if result . success? end end
TODO: must be a critical section, double creation is possible!
TODO : must be a critical section double creation is possible!