Add the author name for #40782 in the CHANGELOG [ci skip]

This commit is contained in:
Ryuta Kamizono 2020-12-30 14:44:02 +09:00
parent f58b7250ae
commit e563d28054
1 changed files with 12 additions and 13 deletions

View File

@ -19,29 +19,28 @@
* Makes `ActiveRecord::AttributeMethods::Query` respect the getter overrides defined in the model.
Fixes #40771.
Before:
```ruby
class User
def admin
false # Overriding the getter to always return false
end
class User
def admin
false # Overriding the getter to always return false
end
end
user = User.first
user.update(admin: true)
user.admin # false (as expected, due to the getter overwrite)
user.admin? # true (not expected, returned the DB column value)
user = User.first
user.update(admin: true)
user.admin # false (as expected, due to the getter overwrite)
user.admin? # true (not expected, returned the DB column value)
```
After this commit, `user.admin?` above returns false, as expected.
Fixes #40771.
*Felipe*
* Allow delegated_type to be specified primary_key and foreign_key.
Since delegated_type assumes that the foreign_key ends with `_id`,