Conversation
amomchilov
reviewed
Sep 3, 2026
Comment on lines
+9
to
+19
| sig { params(auth_object: T.untyped).returns(T::Array[String]) } | ||
| def ransackable_associations(auth_object = nil); end | ||
|
|
||
| sig { params(auth_object: T.untyped).returns(T::Array[String]) } | ||
| def ransackable_attributes(auth_object = nil); end | ||
|
|
||
| sig { params(auth_object: T.untyped).returns(T::Array[Symbol]) } | ||
| def ransackable_scopes(auth_object = nil); end | ||
|
|
||
| sig { params(auth_object: T.untyped).returns(T::Array[String]) } | ||
| def ransortable_attributes(auth_object = nil); end |
Contributor
There was a problem hiding this comment.
Suggested change
| sig { params(auth_object: T.untyped).returns(T::Array[String]) } | |
| def ransackable_associations(auth_object = nil); end | |
| sig { params(auth_object: T.untyped).returns(T::Array[String]) } | |
| def ransackable_attributes(auth_object = nil); end | |
| sig { params(auth_object: T.untyped).returns(T::Array[Symbol]) } | |
| def ransackable_scopes(auth_object = nil); end | |
| sig { params(auth_object: T.untyped).returns(T::Array[String]) } | |
| def ransortable_attributes(auth_object = nil); end | |
| sig { overridable.params(auth_object: T.untyped).returns(T::Array[String]) } | |
| def ransackable_associations(auth_object = nil); end | |
| sig { overridable.params(auth_object: T.untyped).returns(T::Array[String]) } | |
| def ransackable_attributes(auth_object = nil); end | |
| sig { overridable.params(auth_object: T.untyped).returns(T::Array[Symbol]) } | |
| def ransackable_scopes(auth_object = nil); end | |
| sig { overridable.params(auth_object: T.untyped).returns(T::Array[String]) } | |
| def ransortable_attributes(auth_object = nil); end |
mokevnin
force-pushed
the
add-ransack-annotation
branch
from
September 6, 2026 16:51
bb4c596 to
dc82d61
Compare
Contributor
Author
|
Thanks — |
`ransack` ships no signatures. The four allowlist class methods every host model overrides, and `Search#result`, are the gem's whole public surface for application code, and tapioca emits all five without a sig. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mokevnin
force-pushed
the
add-ransack-annotation
branch
from
September 19, 2026 16:42
dc82d61 to
f6d4685
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Changes
ransacklib/ransack/adapters/active_record/base.rb,lib/ransack/search.rb#L44ransackships no signatures, so tapioca emits these five methods sig-less. They are the methods application code actually touches: every host model must override the four allowlist methods, andresultis how a search is turned into a query.Ransack::Adapters::ActiveRecord::Base#ransackable_attributes/#ransackable_associations→T::Array[String]: the default implementations returnauthorizable_ransackable_attributes/_associations, which arecolumn_names + _ransackers.keys + _ransack_aliases.keys + attribute_aliases.keysandreflect_on_all_associations.map { |a| a.name.to_s }— strings in both cases, and the doc comments say "as an array of strings".#ransortable_attributes→T::Array[String]: delegates toransackable_attributes(auth_object).#ransackable_scopes→T::Array[Symbol]: returns[], and its doc comment specifies "a whitelist array of symbols".Ransack::Search#result→ActiveRecord::Relation: returns@context.evaluate(self, opts);Context.foronly ever buildsRansack::Adapters::ActiveRecord::Context(the AR adapter is the only one the gem ships), and both branches of itsevaluate(relation.distinctorrelation) return a relation.auth_objectis leftT.untyped— the gem passes whatever the host app puts inSearch'sauth_object:option and never inspects it.The index entry needs
requires: ["active_record", "ransack"]:require "ransack"alone defers ActiveRecord to anActiveSupport.on_load(:active_record)hook that never fires, soActiveRecord::Relationdoes not resolve in the static check. Nodependenciesentry —activerecordis already a runtime dependency of the gem.bundle exec repo check --gem --ref origin/mainpasses all five checks locally.