`has_secure_password` reset token finders are missing from DSL RBIs
Maintainer thường phản hồi trong vòng 2 ngày
Đá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
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Shopify/tapioca
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Shopify/tapioca#2662 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Option to omit private methods from gem RBIs, with a per-gem opt-inCó thể đã có người làm @efegokdemir đã nhận 14 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Constants defined under a payload alias (YAML = Psych) are emitted under the alias name, rejected by sorbet >= 0.6.13550Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Improve `check-shims` performanceCó thể đã có người làm @KaanOzkan đã nhận 28 ngày trước. Đang mở
Shopify/tapioca#2728 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của Shopify/tapioca
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
L: javascript
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dependabot/dependabot-core#16744 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:core-lib P2 size:S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày