Skip to content

Incompatible with multiverse gem after upgrading to v0.9.6 (assumption) #80

@DmytroStepaniuk

Description

@DmytroStepaniuk

In my model there was statement like:

establish_connection "my_connection_#{ Rails.env }"

In this case there was used multiverse gem to configure 2nd DB in rails 4 project

after upgrading to v0.9.6 now it fails because of

NameError:
  undefined method `execute' for class `ActiveRecord::ConnectionAdapters::PostgreSQLAdapter'
gems/database_rewinder-0.9.6/lib/database_rewinder/active_record_monkey.rb:39:in `instance_method'
gems/database_rewinder-0.9.6/lib/database_rewinder/active_record_monkey.rb:39:in `prepended'
gems/database_rewinder-0.9.6/lib/database_rewinder/active_record_monkey.rb:66:in `prepend'
gems/database_rewinder-0.9.6/lib/database_rewinder/active_record_monkey.rb:66:in `inherited'
gems/activerecord-xxxx/lib/active_record/connection_adapters/postgresql_adapter.rb:76:in `<module:ConnectionAdapters>'
gems/activerecord-xxxx/lib/active_record/connection_adapters/postgresql_adapter.rb:48:in `<module:ActiveRecord>'
gems/activerecord-xxxx/lib/active_record/connection_adapters/postgresql_adapter.rb:21:in `<top (required)>'
gems/activesupport-xxxx/lib/active_support/dependencies.rb:274:in `require'
gems/activesupport-xxxx/lib/active_support/dependencies.rb:274:in `block in require'
gems/activesupport-xxxx/lib/active_support/dependencies.rb:240:in `load_dependency'
gems/activesupport-xxxx/lib/active_support/dependencies.rb:274:in `require'
gems/activerecord-xxxx/lib/active_record/connection_adapters/connection_specification.rb:175:in `spec'
gems/activerecord-xxxx/lib/active_record/connection_handling.rb:50:in `establish_connection'
my_record.rb:3:in `<class:MyRecord>'
my_record.rb:1:in `<top (required)>'
gems/activesupport-xxxx/lib/active_support/dependencies.rb:274:in `require'
gems/activesupport-xxxx/lib/active_support/dependencies.rb:274:in `block in require'
gems/activesupport-xxxx/lib/active_support/dependencies.rb:240:in `load_dependency'
gems/activesupport-xxxx/lib/active_support/dependencies.rb:274:in `require'
gems/activesupport-xxxx/lib/active_support/dependencies.rb:360:in `require_or_load'
gems/activesupport-xxxx/lib/active_support/dependencies.rb:494:in `load_missing_constant'
gems/activesupport-xxxx/lib/active_support/dependencies.rb:184:in `const_missing'

Just saw that there were some changes around that in the gem.
I hope it can help with debugging issues like that 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions