`has_secure_password` reset token finders are missing from DSL RBIs
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
調査の方向性
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 ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Shopify/tapioca のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Shopify/tapioca#2662 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Option to omit private methods from gem RBIs, with a per-gem opt-in対応中かも @efegokdemir が 16 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
メンテナーはふだん 1 日以内に返信
-
Constants defined under a payload alias (YAML = Psych) are emitted under the alias name, rejected by sorbet >= 0.6.13550対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 57/100
メンテナーはふだん 1 日以内に返信
-
Improve `check-shims` performance対応中かも @KaanOzkan が 31 日前に担当しました。 オープン
Shopify/tapioca#2728 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
メンテナーはふだん 1 日以内に返信
Shopify/tapioca の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
heartcombo/simple_form#1874 ·
-
Category: OneSwap Status: Accepted
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
OpenNebula/one#8237 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
AllYourBot/hostedgpt#882 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
greenelab/lab-website-template#357 · コメント 1 件 ·