Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Consolidate app/queries/ and app/queriers/ into a single query-objects folder

已关闭 适合新手
#2,943 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
84/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
rails, ruby
领域
backend

调研方向

先阅读 Admin::WorkshopConcerns 和入口 Admin::WorkshopsController#show,然后在 app/queriers/ 下找到 AdminWorkshopAttendeeFlags。将其移动到 app/queries/,不要修改其调用方,然后运行 Admin::WorkshopsController#show 和 dashboard 的 spec。完成标准是 app/queriers/ 已不存在、该类可以从 app/queries/ 解析,并且列出的两个测试区域都通过。

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

描述

good first issue refactoring tech debt

Problem

The repo has two folders for the same concept, with three different class shapes between them:

Folder Class Shape Used by
app/queries/ DashboardQuery class-level methods (upcoming_events, total_upcoming_events_count) DashboardController
app/queries/ SponsorsSearch ActiveModel::Model object with attr_accessor :name, :chapter Admin::SponsorsController
app/queriers/ AdminWorkshopAttendeeFlags self.for_members(member_ids) → instance #to_h Admin::WorkshopConcerns

queriers is not a name Rails developers recognise as an autoload convention (app/queries is), and the split isn't semantic — AdminWorkshopAttendeeFlags is the same kind of code as DashboardQuery: batched aggregate queries for controllers.

Proposed change

  • Move AdminWorkshopAttendeeFlags from app/queriers/ to app/queries/ and delete app/queriers/.
  • Leave the three existing call shapes alone for now — normalising DashboardQuery/SponsorsSearch interfaces is out of scope and needs its own discussion.

Acceptance

  • app/queriers/ no longer exists; AdminWorkshopAttendeeFlags resolves from app/queries/.
  • Callers unchanged (Admin::WorkshopConcerns references the same class name).
  • Admin::WorkshopsController#show and the dashboard specs pass.
主要语言
Ruby
星标
104
派生
205
平均合并
1 天 4 小时
30 天内合并 PR
77

环境准备

  • 提供 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 摘要。