Move the "physical workshop needs a host" validation onto Workshop
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 78/100
Línea de trabajo
Start with Admin::WorkshopsController, especially workshop_type_valid? and physical_workshop_and_no_host?, then inspect the Workshop model and existing admin workshop controller specs. Move the physical-workshop host rule into Workshop while preserving the host error message, add model specs for the validation, and run the existing controller specs to confirm the flash behaviour remains unchanged.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Parent: #2938
Problem
Admin::WorkshopsController enforces the rule "a physical workshop must have a host" in the controller (workshop_type_valid? plus physical_workshop_and_no_host?), adding a validation error from the controller:
def workshop_type_valid?
return true unless physical_workshop_and_no_host?(@workshop)
@workshop.errors.add(:host, "can't be blank")
false
end
Validation rules belong on the model so create, update, and any future caller get them for free.
Proposed change
- Move the rule into a
Workshopvalidation, reusing the controller's intent and error message (host"can't be blank"). - Delete
workshop_type_valid?andphysical_workshop_and_no_host?from the controller; thecreate/updateflows keep their existing flash behaviour via@workshop.errors.
Acceptance
- Creating/updating a physical workshop without a host fails with the same error message as today.
- Model specs cover the new validation; existing admin workshop controller specs pass.
- Lenguaje dominante
- Ruby
- Estrellas
- 106
- Forks
- 208
- Merge medio
- 19 h 51 min
- PR fusionados (30 d)
- 57
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de codebar/planner
-
Preload workshop_host in DashboardQuery.upcoming_events_for_user (per-workshop N+1 on /dashboard)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoperformance
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
codebar/planner#3070 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 Medio día Aptitud para principiantes 35/100
codebar/planner#3069 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dual Invitiation issuePosiblemente ocupada @mroderick la tomó hace 19 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
codebar/planner#3008 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de codebar/planner
Issues similares
-
area/web interface
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
rubys/roundhouse#1757 ·
-
Dificultad 2/5 Medio día Aptitud para principiantes 72/100
shakacode/react-on-rails-demo-flagship#102 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
akitaonrails/ai-book-2026#12 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
openfoodfoundation/openfoodnetwork#14970 ·
Los mantenedores suelen responder en 1 día