aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/autocomplete_lines_controller.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/app/controllers/autocomplete_lines_controller.rb b/app/controllers/autocomplete_lines_controller.rb
index 0202ea054..6f5009390 100644
--- a/app/controllers/autocomplete_lines_controller.rb
+++ b/app/controllers/autocomplete_lines_controller.rb
@@ -8,15 +8,12 @@ class AutocompleteLinesController < ChouetteController
def collection
@lines = referential.line_referential.lines
- filter = <<~SQL
- lines.number LIKE ?
- OR lines.name LIKE ?
- OR companies.name ILIKE ?
- SQL
@lines = @lines
.joins(:company)
- .where(
- filter,
+ .where('
+ lines.number LIKE ?
+ OR lines.name LIKE ?
+ OR companies.name ILIKE ?',
*Array.new(3, "%#{params[:q]}%")
)
.search(params[:q])