From d50b4e7dd61bbdb3539c1529b5d6a361325ef609 Mon Sep 17 00:00:00 2001 From: Chedli Bourguiba Date: Wed, 31 Dec 2025 15:19:48 +0100 Subject: [PATCH] Allow instance_variable_get for gems than need low level acces example, `Rails` uses `instance_variable_get` to get access to the underlying Pg gem adapter object, to do some low level manipulation: cf. https://github.com/rails/rails/blob/aa1bee96f565b2f894e4b9eef434990ecfaaa833/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L340 --- lib/console1984/freezeable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/console1984/freezeable.rb b/lib/console1984/freezeable.rb index 3f68c21..8be3142 100644 --- a/lib/console1984/freezeable.rb +++ b/lib/console1984/freezeable.rb @@ -28,7 +28,7 @@ def self.included(base) end module ClassMethods - SENSITIVE_INSTANCE_METHODS = %i[ instance_variable_get instance_variable_set ] + SENSITIVE_INSTANCE_METHODS = %i[ instance_variable_set ] def prevent_instance_data_manipulation SENSITIVE_INSTANCE_METHODS.each do |method|