Skip to content
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

Improve error message of ActiveSupport delegate #36129

Merged

Conversation

okuramasafumi
Copy link
Contributor

Summary

ActiveSupport delegate has to option, but it's not an option hash anymore and now it's a keyword argument.
When to argument is not given, it raises an ArgumentError but the message suggests supplying "options hash", which is now wrong.
Now it's fixed to provide correct suggestion to supply a keyword argument.

@kamipo
Copy link
Member

kamipo commented Apr 29, 2019

This is a code change, can you remove [ci skip]?

@okuramasafumi
Copy link
Contributor Author

Oops, sorry!

ActiveSupport `delegate` has `to` option, but it's not a option hash
anymore and now it's a keyword argument.
When `to` argument is not given, it raises an ArgumentError but
the message suggests supplying "options hash", which is now wrong.
Now it's fixed to provide correct suggestion to supply a keyword
argument.
@okuramasafumi okuramasafumi changed the title [ci skip] Improve error message of ActiveSupport delegate Improve error message of ActiveSupport delegate Apr 29, 2019
@okuramasafumi okuramasafumi force-pushed the improve-error-message-of-delegate branch from 1e8b4ae to fd205ed Compare April 29, 2019 05:11
@kamipo kamipo merged commit e6c177e into rails:master Apr 29, 2019
@okuramasafumi okuramasafumi deleted the improve-error-message-of-delegate branch April 29, 2019 13:29
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.

None yet

2 participants