customink / secondbase

Seamless second database integration for Rails.
MIT License
220 stars 31 forks source link

Secondbase no longer works with Ransack gem. #56

Closed lcpriest closed 2 months ago

lcpriest commented 6 years ago

I noticed this when using Secondbase with ActiveAdmin. The change occurred 10 days in this commit.

https://github.com/activerecord-hackery/ransack/commit/d44575506ccc7cb00e618256707ed53732a07bca

As you can see, moving from schema_cache = @engine.connection.schema_cache to schema_cache = ::ActiveRecord::Base.connection.schema_cache will exclude SecondBase tables.

It will now throw an error "RuntimeError (No table named #{table_name} exists.)" when attempting to use custom filters like "#{column_name}_contains"

metaskills commented 6 years ago

Good to know. In general, I've seen updates like this to Arel ruin my day when doing SQL Server adapter work. Often times that remove private ivars that were critical for 3rd party gems that rails-core never used or saw a need for.

I have subscribed to the Ransack issue to follow along and see where this goes. Thanks!