Move workshop domain rules out of Admin::WorkshopsController

未关闭
#2,938 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
停滞
技术栈
rails, ruby
领域
backend

调研方向

This umbrella issue is decomposed into #2939, #2940, and #2941, so start with the relevant sub-issue rather than changing it directly. Read Admin::WorkshopsController and Workshop, then follow the named methods and destroy path. Done means each independently shippable extraction is implemented and the controller no longer owns the specified domain rules.

由索引模型根据 Issue 内容生成。

描述

refactoring tech debt

Problem

Admin::WorkshopsController is the largest controller in the app (~295 lines) and holds domain logic below the presentation layer:

  1. Domain validation in the controller (workshop_type_valid? adds a model error from the controller)
  2. Deletion policy in the controller (4-hour window + no-invitees rule)
  3. Organiser grant/revoke role diffing in private controller methods

Plan

This decomposes into three independent, individually shippable changes, tracked as sub-issues:

  • #2939 — Move the "physical workshop needs a host" validation onto Workshop
  • #2940 — Add Workshop#deletable? and use it in Admin::WorkshopsController#destroy
  • #2941 — Extract organiser grant/revoke diffing from Admin::WorkshopsController

Each can land separately; no ordering required.

主要语言
Ruby
星标
106
派生
208
平均合并
19 小时 51 分钟
30 天内合并 PR
57

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

codebar/planner 的其他 Issue

查看 codebar/planner 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。