Closed mklnz closed 6 years ago
Hi @mklnz
There's currently no way to explicitly tell the gem that you're using Mongoid, it assumes that if it's installed you're not also including AR.
I've never tried this specific scenario, but I am a bit surprised by the error. Will you please provide a backtrace on this error? A sample application that recreates this error would also be helpful. Maybe there's a workaround we can come up with for this case.
Sorry for the late reply. Here is a demo app I've created with AR loaded but not used. In my real app most models are Mongoid except 1 or 2 which are subclassed from AR. However having AR loaded is enough to cause ransack errors by clicking the Post model in /admin
Great, I was able to get this running and re-create the error you're talking about. I'll see what I can come up with for a solution.
@mklnz At this time, I don't think we'll be able to support AR + Mongoid in the same application. If you have the time to write a shim or make and test the change to this repo, please do.
I've been trying the rails5-mongoid6 branch and I have a project with both Mongoid and ActiveRecord for some legacy models using a different database.
Normally without activeadmin there is no problem, each model uses its own ORM. However when I add in activeadmin-mongoid, it automatically assumes it's AR and not Mongoid and causes this error:
If I remove the
require "active_record/railtie"
line fromapplication.rb
, ActiveAdmin works but the rest of my app is broken.Is there a way to force active_admin to use Mongoid mode even if AR is loaded?