-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[4.2.0-rc1] reset_column_information definitely drop attribute methods #17900
Comments
/cc @sgrif |
I'll look into it |
This was introduced by 84cf156. I think there's a better solution that doesn't involve method missing, however. |
I'm also unsure if this is a case that we really need to worry about? |
It is after each migrations. So if you have a migration that used |
Also I have that test in my gem because we had the issue in production. |
I found a very simple fix that do not involve method missing. PR on his way. |
Active Record defines `attribute_method_suffix :?`. That suffix will match any predicate method when the lookup occurs in Active Model. This will make it incorrectly decide that `id_changed?` should not exist, because it attempts to determine if the attribute `id_changed` is present, rather than `id` with the `_changed?` suffix. Instead, we will look for any correct match. Fixes #17900
Thanks! |
Sample app to reproduce: https://github.com/byroot/reset_column_information-bug
The test case:
Under 4.2:
Works fine under 4.1. I'll try to figure out where it come from.
cc @rafaelfranca @pixeltrix
The text was updated successfully, but these errors were encountered: