I am encountering an issue with Rails version 7.1.3.2, where certain expected behaviors are not functioning as anticipated. Specifically, the use of ActiveRecord::Base.connection.execute seems to trigger the proxy execution correctly, as demonstrated below:
irb(main):001> ActiveRecord::Base.connection.execute('select * from users limit 1')
[writing] (3.9ms) select * from users limit 1
However, when attempting to use other ActiveRecord methods such as find or where, the proxy does not appear to be executed. For instance:
irb(main):003> User.find(1)
User Load (1.4ms) SELECT `users`.`id`, ...
It is my concern that these changes may have inadvertently affected the ability to execute hooks within execute. I am seeking guidance or confirmation on whether this behavior is indeed a result of the recent changes, and if so, how it might be addressed or worked around.
I am encountering an issue with Rails version 7.1.3.2, where certain expected behaviors are not functioning as anticipated. Specifically, the use of ActiveRecord::Base.connection.execute seems to trigger the proxy execution correctly, as demonstrated below:
However, when attempting to use other ActiveRecord methods such as
find
orwhere
, the proxy does not appear to be executed. For instance:Upon reviewing the changes made to Rails, it seems that the internal call implementation within
execute
has been modified to something likeinternal_execute
. This alteration can be observed in the following commit: https://github.com/rails/rails/commit/63c0d6b31bcd0fc33745ec6fd278b2d1aab9be54#diff-88e231c48eb5559ac3be58a024b019e86f7c74d388f5d49fac3f4e47bf851cc6It is my concern that these changes may have inadvertently affected the ability to execute hooks within
execute
. I am seeking guidance or confirmation on whether this behavior is indeed a result of the recent changes, and if so, how it might be addressed or worked around.