ajax-datatables-rails icon indicating copy to clipboard operation
ajax-datatables-rails copied to clipboard

Includes the same table unable to filter

Open gaiapuffo opened this issue 7 years ago • 0 comments
trafficstars

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

gaiapuffo avatar Oct 17 '18 10:10 gaiapuffo