Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`has_secure_password` reset token finders are missing from DSL RBIs

オープン
#2,749 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@RaphaelFakhri がすでに取り組んでいます。

2026年10月22日 から。

  • #2750 @RaphaelFakhri による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rails, ruby
領域
backend, tooling

調査の方向性

Start by reading the ActiveModelSecurePassword DSL compiler and the code that defines the reset token finders with class_eval; the issue says the compiler currently reads InstanceMethodsOnActivation. Run bin/tapioca dsl User with the reproduction model and inspect the generated RBI. Done when both finder methods appear with the documented return types and the generated RBI tests cover them.

索引モデルが issue の本文から書いたものです。

説明

Description

Since Rails 8.0, has_secure_password on an Active Record model also defines two class methods for the reset token:

  • find_by_<attribute>_reset_token(token)
  • find_by_<attribute>_reset_token!(token)

The ActiveModelSecurePassword DSL compiler generates the instance method <attribute>_reset_token, but not these finders. They are defined with class_eval directly on the model, outside the InstanceMethodsOnActivation module the compiler reads.

Reproduction
class User < ActiveRecord::Base
  has_secure_password
end

Run bin/tapioca dsl User. The generated RBI contains password_reset_token, but no find_by_password_reset_token or find_by_password_reset_token!.

Calling the documented API then fails type checking:

User.find_by_password_reset_token(params[:token])
# Method `find_by_password_reset_token` does not exist on `T.class_of(User)`
Expected

The generated RBI includes:

class << self
  sig { params(token: String).returns(T.nilable(User)) }
  def find_by_password_reset_token(token); end

  sig { params(token: String).returns(User) }
  def find_by_password_reset_token!(token); end
end
主要言語
Ruby
スター
874
フォーク
170
平均マージ
22時間 54分
マージ済み PR(30日)
8

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Shopify/tapioca のほかの issue

Shopify/tapioca の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。