Skip to content

feat(devise): Add types for URL helpers - #1096

Merged
github-actions[bot] merged 1 commit into
ruby:mainfrom
apiology:devise-url-helpers
Oct 13, 2026
Merged

github-actions[bot] merged 1 commit into
ruby:mainfrom
apiology:devise-url-helpers

Conversation

@apiology

Copy link
Copy Markdown
Contributor

Claude: This PR was written by Claude Code on behalf of @apiology.

Devise includes Devise::Controllers::UrlHelpers into every controller and view, but the devise RBS doesn't declare it, so Steep rejects scoped route proxies such as new_session_path(:user) and cancel_registration_url(:user), and Solargraph can't infer their types:

test.rb:84:4: [error] Type `::ApplicationController` does not have method `cancel_registration_path`

This adds Devise::Controllers::UrlHelpers with the 28 _path/_url methods that generate_helpers! defines from Devise::URL_HELPERS at load time (session, password, registration, confirmation, unlock). It includes the module into ActionController::Base, ActionController::API and ActionView::Base, matching devise's Devise.include_helpers hooks for :action_controller and :action_view.

Devise::OmniAuth::UrlHelpers is not covered.

🤖 Generated with Claude Code

Devise includes Devise::Controllers::UrlHelpers into every controller
and view via ActiveSupport.on_load(:action_controller) and
on_load(:action_view), but the collection declared none of it, so
scoped route proxies such as new_session_path(:user) and
cancel_registration_url(:user) were unknown on ActionController::Base,
ActionController::API and ActionView::Base.

Declare the 28 path/url helpers that generate_helpers! defines from
Devise::URL_HELPERS at load time, and include the module where devise
does. OmniAuth's UrlHelpers are not covered.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhUSLUimEYJyCZv8NdQGKb
@apiology
apiology marked this pull request as ready for review October 13, 2026 14:41
@github-actions

Copy link
Copy Markdown

@apiology Thanks for your contribution!

Please follow the instructions below for each change.
See also: https://github.com/ruby/gem_rbs_collection/blob/main/docs/CONTRIBUTING.md

Available commands

You can use the following commands by commenting on this PR.

  • /merge: Merge this PR if CI passes

devise

You changed RBS files for an existing gem.
This gem does not have reviewers. So you can merge this PR immediately if the CI passes.
We recommend you add yourself to the reviewers for this gem.

@apiology

Copy link
Copy Markdown
Contributor Author

/merge

@github-actions
github-actions Bot merged commit c26eeb2 into ruby:main Oct 13, 2026
7 checks passed
apiology added a commit to iftheshoefritz/solargraph-rails that referenced this pull request Oct 14, 2026
* Bump gem_rbs_collection to c26eeb2 for devise URL helpers

ruby/gem_rbs_collection#1096 added Devise::Controllers::UrlHelpers, so
ActionController::Base#cancel_registration_path and
#cancel_registration_url now resolve to String on Solargraph 0.60.4
and 0.61.0 instead of undefined.

The other collection commits between c78df6c and c26eeb2 add Rails 8.1
types and unrelated gems; FORCE_UPDATE on 0.60.4 and 0.61.0 with Rails
8.0 changed no other entry.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhUSLUimEYJyCZv8NdQGKb

* Stop skipping the typed Devise URL helpers

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhUSLUimEYJyCZv8NdQGKb

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant