Skip to content

Commit e563d28

Browse files
committed
Add the author name for rails#40782 in the CHANGELOG [ci skip]
1 parent f58b725 commit e563d28

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

activerecord/CHANGELOG.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,28 @@
1919

2020
* Makes `ActiveRecord::AttributeMethods::Query` respect the getter overrides defined in the model.
2121

22-
Fixes #40771.
23-
2422
Before:
2523

2624
```ruby
27-
class User
28-
29-
def admin
30-
false # Overriding the getter to always return false
31-
end
32-
25+
class User
26+
def admin
27+
false # Overriding the getter to always return false
3328
end
29+
end
3430
35-
user = User.first
36-
user.update(admin: true)
37-
38-
user.admin # false (as expected, due to the getter overwrite)
39-
user.admin? # true (not expected, returned the DB column value)
31+
user = User.first
32+
user.update(admin: true)
4033
34+
user.admin # false (as expected, due to the getter overwrite)
35+
user.admin? # true (not expected, returned the DB column value)
4136
```
4237

4338
After this commit, `user.admin?` above returns false, as expected.
4439

40+
Fixes #40771.
41+
42+
*Felipe*
43+
4544
* Allow delegated_type to be specified primary_key and foreign_key.
4645

4746
Since delegated_type assumes that the foreign_key ends with `_id`,

0 commit comments

Comments
 (0)