pennylane-hq / activerecord-adapter-redshift

Other
6 stars 26 forks source link

Connection type registration broken on ROR 7.1 #35

Closed redterror closed 2 months ago

redterror commented 2 months ago

The registration-related commit in #34 unfortunately breaks in ROR 7.1, as ActiveRecord::ConnectionAdapters doesn't have a register method prior to 7.2. Specifically I get this at boot time for my app:

NoMethodError: undefined method `register' for ActiveRecord::ConnectionAdapters:Module

Locking the sha at c3d9315 puts me back in a working state.

r-plus commented 2 months ago

I also confirmed this error on Rails 7.1.4.

/home/circleci/server/vendor/bundle/ruby/3.3.0/bundler/gems/activerecord-adapter-redshift-04858f87dbea/lib/activerecord7-redshift-adapter-pennylane.rb:5:in `block (2 levels) in <class:Railtie>': undefined method `register' for module ActiveRecord::ConnectionAdapters (NoMethodError)
        from /home/circleci/server/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.4/lib/active_support/lazy_load_hooks.rb:97:in `class_eval'
        from /home/circleci/server/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.4/lib/active_support/lazy_load_hooks.rb:97:in `block in execute_hook'
        from /home/circleci/server/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.4/lib/active_support/lazy_load_hooks.rb:87:in `with_execution_control'
        from /home/circleci/server/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.4/lib/active_support/lazy_load_hooks.rb:92:in `execute_hook'
        from /home/circleci/server/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.4/lib/active_support/lazy_load_hooks.rb:62:in `block in on_load'
        from /home/circleci/server/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.4/lib/active_support/lazy_load_hooks.rb:61:in `each'
        from /home/circleci/server/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.4/lib/active_support/lazy_load_hooks.rb:61:in `on_load'
        from /home/circleci/server/vendor/bundle/ruby/3.3.0/bundler/gems/activerecord-adapter-redshift-04858f87dbea/lib/activerecord7-redshift-adapter-pennylane.rb:4:in `block in <class:Railtie>'