File tree Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change 19
19
20
20
* Makes ` ActiveRecord::AttributeMethods::Query` respect the getter overrides defined in the model.
21
21
22
- Fixes # 40771.
23
-
24
22
Before:
25
23
26
24
` ` ` 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
33
28
end
29
+ end
34
30
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)
40
33
34
+ user.admin # false (as expected, due to the getter overwrite)
35
+ user.admin? # true (not expected, returned the DB column value)
41
36
` ` `
42
37
43
38
After this commit, ` user.admin?` above returns false , as expected.
44
39
40
+ Fixes # 40771.
41
+
42
+ * Felipe *
43
+
45
44
* Allow delegated_type to be specified primary_key and foreign_key.
46
45
47
46
Since delegated_type assumes that the foreign_key ends with ` _id` ,
You can’t perform that action at this time.
0 commit comments