Skip to content

fix(console): Fix console helpers #3647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2025
Merged

fix(console): Fix console helpers #3647

merged 1 commit into from
May 15, 2025

Conversation

julienbourdeau
Copy link
Contributor

Rails 8.0 removed deprecated Rails::ConsoleMethods, which broke our console helpers.
This PR uses the new way of defining console helper, which I should have used from the beginning 😬

As I'm on support, I really miss the find helper!

def find(id)
if /^gid/.match?(id)
GlobalID::Locator.locate(id)
elsif Regex::EMAIL.match?(id)
User.find_by email: id
else
raise "Don't know how to resolve this ¯\\_(ツ)_/¯. Please provide a valid email or Global ID."
end
end

@julienbourdeau julienbourdeau self-assigned this May 15, 2025
@julienbourdeau julienbourdeau merged commit 13c0d7f into main May 15, 2025
14 checks passed
@julienbourdeau julienbourdeau deleted the fix/console branch May 15, 2025 09:29
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.

2 participants