ransack icon indicating copy to clipboard operation
ransack copied to clipboard

Remove Polyamorous and Adapters namespaces

Open scarroll32 opened this issue 3 months ago • 5 comments

The Polyamorous and Adapters namespaces are there for historical reasons:

  • Polyamorous was previously an independent gem
  • Ransack used to support MongoDB, this has been dropped

Goal: Refactor these namespaces out for simplicity. This would be a predecessor to https://github.com/activerecord-hackery/ransack/issues/1631

scarroll32 avatar Sep 24 '25 23:09 scarroll32

Hi @scarroll32

are you plans to melt Polyamorous into ransack or just move it to a better location? It is still required by baby_squeel require 'polyamorous/polyamorous' I know baby_squeel is just used by a couple of people and there is no current release but I'm stuck with it and try to keep it going. - https://github.com/rzane/baby_squeel/pull/133

rocket-turtle avatar Sep 29 '25 09:09 rocket-turtle

Hi @rocket-turtle thanks for the heads up.

Polyamorous was officially retired back in 2019, I had always planned to remove it completely from Ransack.

I think there are 2 options here:

  1. Fork https://github.com/activerecord-hackery/polyamorous under rzane, apply the 7.2 patches and point to it
  2. Pull the Polyamorous code from Ransack directly into baby_squeel

I think we are seeing Ariel stablise now, and soon there probably won't be a need for different ActiveRecord version code paths. I really have limited time to support Ransack but it is a widely used gem (by myself also!). I am trying to get it to a super-stable place so it needs less attention.

scarroll32 avatar Sep 29 '25 10:09 scarroll32

Hi,

thank you for your input. I think im going with the second option and hope for the best. :)

Can you tell me why this change was reverted? https://github.com/activerecord-hackery/ransack/pull/1618/files

rocket-turtle avatar Sep 30 '25 08:09 rocket-turtle

Good luck with it @rocket-turtle I wasn't directly involved in that change, but I think it is because there is no Rails 7.3 - it went directly from 7.2.x to 8.x, see this page https://rubygems.org/gems/rails/versions

The version in the code there is actually now out of date and needs to be updated to 7.2.2.2.

If you have time feel free to make a PR to Ransack, might be a good dry-run for your changes!

scarroll32 avatar Sep 30 '25 12:09 scarroll32

There are folks using ransack with mongoid, so even if it isn't supported by core, it would be nice to give them an avenue to create an adapter for it. And maybe a different ORM than Active Record gets popular in the future and someone makes an adapter for that. So I wouldn't kill the adapter setup.

gregmolnar avatar Oct 01 '25 17:10 gregmolnar