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

no results in the dropdown #28

Open
davideghz opened this issue Nov 27, 2017 · 3 comments
Open

no results in the dropdown #28

davideghz opened this issue Nov 27, 2017 · 3 comments

Comments

@davideghz
Copy link

davideghz commented Nov 27, 2017

Hi, I defined a filter like:

filter :treatment, as: :ajax_select, data: {
  url: :filter_backend_labels_path,
  search_fields: ['treatment_translations.name']
}

It generates the following query:

SQL (16.6ms) SELECT DISTINCT "treatments"."id", "treatment_translations"."name" AS alias_0, treatment_translations.name AS alias_1 FROM "treatments" LEFT OUTER JOIN "treatment_categories" ON "treatment_categories"."id" = "treatments"."treatment_category_id" LEFT OUTER JOIN "treatment_translations" ON "treatment_translations"."treatment_id" = "treatments"."id" WHERE ('t'='t') ORDER BY "treatment_translations"."name" ASC, treatment_translations.name ASC LIMIT 5 OFFSET 0

which leads to no results in the dropdown.

What am I doing wrong?

@davideghz davideghz changed the title no results no results in the dropdown Nov 27, 2017
@holyketzer
Copy link
Owner

Hi, have you checked that this SQL query returns anything?

@davideghz
Copy link
Author

Hi! if I run the query in psql I get the following:

  id  |                      alias_0                       |                      alias_1                       
------+----------------------------------------------------+----------------------------------------------------
 6789 | 10Cavitación + 10Presoterapia                      | 10Cavitación + 10Presoterapia
 5373 | 10 min Masaje extra                                | 10 min Masaje extra
 6781 | 10 Ses Cavitación O Radiofrecuencia Y Presoterapia | 10 Ses Cavitación O Radiofrecuencia Y Presoterapia
 6697 | 10 Sesiones De Ultra-Electroterapia                | 10 Sesiones De Ultra-Electroterapia
 6784 | 10 Sesiones Tto Corporal Elevación De Glúteos      | 10 Sesiones Tto Corporal Elevación De Glúteos

@davideghz
Copy link
Author

Hi! Any idea? :)

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

2 participants