Remove un-necessary monkey-patching of attr_encrypted
What does this MR do and why?
- This monkey patching causes database connections to be opened while loading
config/routes
- This patch was added in gitlab-foss!667 (merged), and since fixed upstream in https://github.com/attr-encrypted/attr_encrypted/pull/160.
- The implementation of
attribute_instance_methods_as_symbols
was later changed to useconnected?
method which is even better because it means we don't open a database connection during routes (see #359913 (closed))
- Furthermore, we now effectively stop using
attribute_instance_methods_as_symbols
, by patching outattribute_instance_methods_as_symbols_available?
to always false. See https://github.com/attr-encrypted/attr_encrypted/blob/3.1.0/lib/attr_encrypted.rb#L145-L158
So we simply don't need this monkey-patch
Also adds a raise if we attempt to upgrade attr_encrypted past 3.1.0.
Related issue: #359913 (closed)
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Thong Kuah