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

Dynamically set distinct option #109

Closed
chrismhilton opened this issue Jul 12, 2012 · 1 comment
Closed

Dynamically set distinct option #109

chrismhilton opened this issue Jul 12, 2012 · 1 comment

Comments

@chrismhilton
Copy link

I would like to set the result :distinct option dynamically depending on whether or not my search requires a join.

Previously when using MetaSearch I was able to determine whether or not a join was required using the following:

@search.join_dependency.join_associations.empty?

Could you please advise how I could implement an equivalent check using Ransack.

@aripollak
Copy link

It looks like distinct is automatically used when necessary now, at least under Rails 4.1. Maybe the explicit distinct option is no longer necessary for most cases?

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