Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`has_secure_password` reset token finders are missing from DSL RBIs

Đang mở
#2,749 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@RaphaelFakhri đang làm issue này rồi.

Từ ngày 22/10/2026.

  • #2750 của @RaphaelFakhri — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rails, ruby
Lĩnh vực
backend, tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Ruby
Star
874
Fork
169
Merge trung bình
3 ngày 6 giờ
Pull request đã merge (30 ngày)
10

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Shopify/tapioca

Tất cả issue của Shopify/tapioca

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.