aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/CHANGELOG.md
diff options
context:
space:
mode:
authorSeb Jacobs <me@sebjacobs.com>2019-03-22 08:20:36 +0000
committerSeb Jacobs <me@sebjacobs.com>2019-03-22 08:28:13 +0000
commit4733e04dfaaa39b22292eef168bc5c1d1638c9b2 (patch)
treefd523644b0d00731ebd3cf8696f8404cac7caf62 /activejob/CHANGELOG.md
parent0a0f115031b64b5335fa88543c40df4194dfb428 (diff)
downloadrails-4733e04dfaaa39b22292eef168bc5c1d1638c9b2.tar.gz
rails-4733e04dfaaa39b22292eef168bc5c1d1638c9b2.tar.bz2
rails-4733e04dfaaa39b22292eef168bc5c1d1638c9b2.zip
Reintroduce support for overriding `has_secure_password` attributes
In Rails 5.2.x calling `has_secure_password` would define attribute readers and writers on the superclass of the model, which meant that you could override these attributes in a model and call the superclass for example: ``` class Dog < ApplicationRecord has_secure_password def password=(new_password) @password_set = new_password.present? super end end ``` However this behaviour was broken in Rails 6 when the ability to customise the name of the attribute was introduced [1] since they are no longer being defined on the superclass you will now see the following error: ``` NoMethodError: super: no superclass method `password=' for #<Dog:0x00007ffbbc7ce290> Did you mean? password ``` In order to resolve this issue and retain support for setting a custom attribute name we can define these attribute readers/writers in a module and then ensure that the module is included in the inheritance chain. [1] https://www.github.com/rails/rails/commit/86a48b4da3 https://www.github.com/rails/rails/commit/9b63bf1dfd
Diffstat (limited to 'activejob/CHANGELOG.md')
0 files changed, 0 insertions, 0 deletions