diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 70d9370e65..4c1eacce06 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -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`,