Dynamically set distinct option #109

Open
chrismhilton opened this Issue Jul 12, 2012 · 1 comment

Projects

None yet

2 participants

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.

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