Skip to content

Be more permissive when detecting frozen objects

gitlab-qa-bot requested to merge github/fork/keegangroth/main into main

Created by: keegangroth

Rather than rely on an object's #frozen? method, always attempt to proxy a method when requested. Catch the errors resulting from failed attempts to proxy and reraise (or log) them with helpful messages.

One notable use case for this is rails' activerecord's Model objects becoming frozen after be deleted. In reality, only the underlying hash of attributes is frozen and it should still be possible to write proxies for these objects.

Merge request reports