Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Ruby 3.2, 3.3 and Rails 7.1 #3

Merged
merged 9 commits into from
May 26, 2024

Commits on May 26, 2024

  1. Configuration menu
    Copy the full SHA
    08b8284 View commit details
    Browse the repository at this point in the history
  2. Use legacy_connection_handling option only when it exists

    ```
      1) ActiveRecord::DebugErrors::DisplayConnectionOwners#execute when ActiveRecord::Deadlocked occurs when the user has the permission to execute 'SHOW ENGINE INNODB STATUS' displays latest detected deadlock
         Failure/Error: ActiveRecord::Base.legacy_connection_handling = false
    
         NoMethodError:
           undefined method `legacy_connection_handling=' for class ActiveRecord::Base
         # ./vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.3/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
         # ./spec/spec_helper.rb:29:in `block (2 levels) in <top (required)>'
    ```
    ohbarye committed May 26, 2024
    Configuration menu
    Copy the full SHA
    e508ef6 View commit details
    Browse the repository at this point in the history
  3. Override translate_exception_class instead of raw_execute and `ex…

    …ecute`
    
    Starting with Rails 7.1, `raw_execute` may not be called when executing a query. This pull request introduces `with_raw_connection`, and this method is now called when executing a query.
    
    https://github.com/rails/rails/pull/44576/files#diff-460f4e7973c5dd945c51d24df5b0173961190d3645f4e2585fd3003fa1fc0ff7R865
    
    Overriding this method and calling super will result in a LocalJumpError, which is not safe.
    
    In this commit, I tried to call the log by hooking into `translate_exception_class`. This method has been around since 4.2, and there should be no changes to the interface since 6.0.
    
    rails/rails@5e5118a#diff-460f4e7973c5dd945c51d24df5b0173961190d3645f4e2585fd3003fa1fc0ff7R356
    ohbarye committed May 26, 2024
    Configuration menu
    Copy the full SHA
    5f9a8c9 View commit details
    Browse the repository at this point in the history
  4. Cause ActiveRecord::ConnectionTimeoutError even in Rails 7.1.3

    `acquire_connection` in connection_pool is now smarter in Rails 7.1.3. Even when running existing tests in Rails7.1.3, `ActiveRecord::ConnectionTimeoutError` no longer occurs because a connection can be obtained by `try_to_checkout_new_connection` after reap.
    
    https://github.com/rails/rails/compare/v7.1.2..v7.1.3#diff-642b90553b888bd2c724c093a1a685a5408a7d8293f3751366c25dc548936eb7R660
    ohbarye committed May 26, 2024
    Configuration menu
    Copy the full SHA
    1688bd0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6214941 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ca6d8e4 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    9cc944f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d2a4654 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    6dbd03f View commit details
    Browse the repository at this point in the history