mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add the author name for #40782 in the CHANGELOG [ci skip]
This commit is contained in:
parent
f58b7250ae
commit
e563d28054
1 changed files with 12 additions and 13 deletions
|
@ -19,17 +19,13 @@
|
|||
|
||||
* 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
|
||||
|
||||
end
|
||||
|
||||
user = User.first
|
||||
|
@ -37,11 +33,14 @@
|
|||
|
||||
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`,
|
||||
|
|
Loading…
Reference in a new issue