Skip to content

Make custom inspect methods more consistent #39477

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
Jun 3, 2020
Merged

Make custom inspect methods more consistent #39477

merged 1 commit into from
Jun 3, 2020

Conversation

p8
Copy link
Member

@p8 p8 commented May 29, 2020

Summary

Calling Object#inspect returns a string starting with a pound sign (#):

=> "#<Object:0x00007fb4b115b428>"

Some custom inspect implementations did not:

ActionController::Parameters.new({}).inspect
=> "<ActionController::Parameters {} permitted: false>"

This change make everything more consistent by always starting with the pound sign.

Move the # outside the < > just like regular Object#inspect
@rails-bot rails-bot bot added the railties label May 29, 2020
@tenderlove tenderlove merged commit 35fe9bc into rails:master Jun 3, 2020
@p8 p8 deleted the improve-inspect branch June 3, 2020 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants