Skip to content

Issues with the Latest Rails 7.1.3.2 Not Working Properly #26

@juri-t

Description

@juri-t

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`, ...

Upon reviewing the changes made to Rails, it seems that the internal call implementation within execute has been modified to something like internal_execute. This alteration can be observed in the following commit: rails/rails@63c0d6b#diff-88e231c48eb5559ac3be58a024b019e86f7c74d388f5d49fac3f4e47bf851cc6

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions