ajax-datatables-rails
ajax-datatables-rails copied to clipboard
Includes the same table unable to filter
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