Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't know what context to use for error when both ORMs #549

Closed
mintuhouse opened this issue Jun 9, 2015 · 4 comments
Closed

Don't know what context to use for error when both ORMs #549

mintuhouse opened this issue Jun 9, 2015 · 4 comments

Comments

@mintuhouse
Copy link

We use both ActiveRecord and Mongoid in our project. When I try to run Admin.ransack or any model.ransack, I get "Don't know what context to use for Admin" error.

May be in context.rb, we need a way to configure or automatically identify the ORM being used for that model and set context appropriately.

@ryansch
Copy link

ryansch commented Jun 9, 2015

Just hit my head on this as well. I ended up forking the gem and commenting out every line that tested for Mongoid and required in the adapters.

The ORM adapters shouldn't be monkey patching the base Context. Context should delegate to an adapter based on the current arguments.

@mintuhouse
Copy link
Author

Duplicate of #499

@jonatack
Copy link
Contributor

jonatack commented Jul 5, 2015

"we need a way to configure or automatically identify the ORM being used for that model and set context appropriately."

Thanks @mintuhouse. Closing as this is a duplicate of #499 as you have noted.

I believe none of the maintainers use Mongoid, and the PRs adding Mongoid were merged in with the caveat that the community would have to maintain that addition.

In other words: Pull requests are welcome 😃

@jonatack
Copy link
Contributor

Fixed with #541.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants