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

Includes the same table unable to filter #309

Open
gaiapuffo opened this issue Oct 17, 2018 · 0 comments
Open

Includes the same table unable to filter #309

gaiapuffo opened this issue Oct 17, 2018 · 0 comments

Comments

@gaiapuffo
Copy link

Hi,

I have a query like this

Aaa::Module::Classification.unscoped.includes(:root_classification)

So I includes the same table...
My table have these fields

root_classication name_classification...
the problem is that in searchable_columns I can make

searchable_columns ||= ['Aaa::Module::Classification.name','Aaa::Module::Classification.name']
When the user insert the name of the classification in the search field
I filter always in base of the name of the classification and never in base of the name root_classication.

This is because the query give a alias to the second table.
I try to make

searchable_columns ||= ['aaa_module_classifications.name','root_classifications_aaa_module_classifications.name']

but i have the error uninitialized constant

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

1 participant