diff options
| author | cedricnjanga | 2018-05-22 07:24:03 -0700 |
|---|---|---|
| committer | Johan Van Ryseghem | 2018-05-23 16:08:41 +0200 |
| commit | 01d99506319cfb3db301afb476e3f124a71871b0 (patch) | |
| tree | c0694c632cc76fcdfc24178d1cffedfb63cabfc9 /app | |
| parent | 9e5609c5f8098efeed3800ba6b9a31f67ebd576a (diff) | |
| download | chouette-core-01d99506319cfb3db301afb476e3f124a71871b0.tar.bz2 | |
Refs #7004 Lower params[:sort] to avoid sort bugs
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/companies_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/companies_controller.rb b/app/controllers/companies_controller.rb index 2c32ed3a5..c359dfd6d 100644 --- a/app/controllers/companies_controller.rb +++ b/app/controllers/companies_controller.rb @@ -44,9 +44,9 @@ class CompaniesController < ChouetteController ids = @q.result(:distinct => true).pluck(:id) scope = scope.where(id: ids) if sort_column && sort_direction - @companies ||= scope.order(sort_column + ' ' + sort_direction).paginate(:page => params[:page]) + @companies ||= scope.order("lower(#{sort_column})" + ' ' + sort_direction).paginate(:page => params[:page]) else - @companies ||= scope.order(:name).paginate(:page => params[:page]) + @companies ||= scope.order('lower(name)').paginate(:page => params[:page]) end end |
