.MD

Copy the markdown below:

NoMethodError

app/models/contest_participant.rb:23

undefined method `optional_gender' for nil:NilClass

Backtrace

app/models/contest_participant.rb:23:in `block in <class:ContestParticipant>'
app/controllers/api/v1/contest_participants_controller.rb:215:in `create'

Request

Name Api::V1::ContestParticipantsController#create
Method POST
URL https://api.oblyk.org/api/v1/gyms/259/contests/232/contest_participants.json
Browser ChromeChrome 146

Parameters

{
  "action": "create",
  "format": "json",
  "gym_id": "259",
  "contest_id": "232",
  "controller": "api/v1/contest_participants",
  "contest_participant": {
    "genre": "male",
    "gym_id": 259,
    "last_name": "Gord",
    "contest_id": 232,
    "first_name": "Jean Pierre",
    "date_of_birth": "1960-01-01",
    "contest_team_id": 161
  }
}

Headers

Host api.oblyk.org
Accept application/json, text/plain, */*
Cf-Ray 9ef23d9d9e7498c4-LUX
Origin https://oblyk.org
Referer https://oblyk.org/
Version HTTP/1.0
Cdn-Loop cloudflare; loops=1
Priority u=1, i
Sec-Ch-Ua "Chromium";v="146", "Not-A.Brand";v="24", "Google Chrome";v="146"
Cf-Visitor {"scheme":"https"}
Connection close
User-Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36
Cf-Ipcountry FR
Authorization [FILTERED]
Sec-Fetch-Dest empty
Sec-Fetch-Mode cors
Sec-Fetch-Site same-site
Accept-Encoding gzip, br
Accept-Language fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7
X-Forwarded-For 87.240.97.200, 172.69.220.132
Cf-Connecting-Ip 87.240.97.200
Sec-Ch-Ua-Mobile ?0
X-Forwarded-Proto https
Httpapiaccesstoken [FILTERED]
Sec-Ch-Ua-Platform "Windows"

Environment

os Linux 5.10.0-14-cloud-amd64
cwd /var/www/oblyk/api/releases/20260419135840
pid 2622879
host oblyk-api
ruby ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
user oblyk
rails 6.0.3.6
revision 32d10418b43110b3eb4a704633ec9cfbbbbaf4d6

Server

Load CPU RAM Swap Disk
oblyk-api Load avg 7% CPU 4% RAM 40% Swap <1% Disk 88%

Deployments 2

Autorise le sous domain embedded et next-embedded à consulter en get les ressourdes de l'url api/embedded clucien 19 Apr 13:58
Ajout d'un alias de first_name vers name pour l'envoie des publications par email clucien 28 Mar 08:29