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
Message on AR::UnknownAttributeError should include the class name of a record #17019
Message on AR::UnknownAttributeError should include the class name of a record #17019
Conversation
0407917
to
adbbf9d
Compare
This would be helpful if 2 models have an attribute that has a similar name to the other. e.g: before: User.new(name: "Yuki Nishijima", projects_attributes: [name: "kaminari"]) # => ActiveRecord::UnknownAttributeError: unknown attribute: name after: User.new(name: "Yuki Nishijima", projects_attributes: [name: "kaminari"]) # => ActiveRecord::UnknownAttributeError: unknown attribute on User: name
adbbf9d
to
074880c
Compare
rebased twice so far. Any chance this pull request could be merged into master? |
Should this handle |
It's a good point, I'll change |
❤️ |
|
After spending some time on this, It turns out that To make
Is that a good idea? Probably not. I think we should change only |
Yes I do not think we should pass the class to any of those subclasses. I
|
…error Message on AR::UnknownAttributeError should include the class name of a record
@yuki24 thank you 💛 reworded the message slightly and shortened the CHANGELOG. |
Thank you! ❤️ ❤️ ❤️ |
Awesome change 👍. |
Error message has been changed on rails/rails#17019 And did_you_mean should be aware of it.
Error message has been changed on rails/rails#17019 and did_you_mean should be aware of it.
This would be helpful if 2 models have an attribute that has a similar name to the other. e.g.
before:
after: