diff options
| author | cedricnjanga | 2017-08-29 14:49:02 +0200 |
|---|---|---|
| committer | cedricnjanga | 2017-08-29 15:25:16 +0200 |
| commit | 58f83fb042087b95d8263af734b2298e6952f9fd (patch) | |
| tree | 64f5b009b0cd9ecab7366e017e731cd677c8f054 /app | |
| parent | 3c85bfbcd31dd9f2d905e8f77020284b68bd38bc (diff) | |
| download | chouette-core-58f83fb042087b95d8263af734b2298e6952f9fd.tar.bz2 | |
Refs #3367 Change Time table overlap query
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/autocomplete_time_tables_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/autocomplete_time_tables_controller.rb b/app/controllers/autocomplete_time_tables_controller.rb index b3add6eca..375928aeb 100644 --- a/app/controllers/autocomplete_time_tables_controller.rb +++ b/app/controllers/autocomplete_time_tables_controller.rb @@ -17,9 +17,9 @@ class AutocompleteTimeTablesController < InheritedResources::Base def select_time_tables scope = params[:source_id] ? referential.time_tables.where("time_tables.id != ?", params[:source_id]) : referential.time_tables if params[:route_id] - scope = scope.joins(vehicle_journeys: :route).where( "routes.id IN (#{params[:route_id]}) AND time_tables.id != #{params[:time_table_id]}") + scope = scope.joins(vehicle_journeys: :route).where( "routes.id IN (#{params[:route_id]})") end - scope + scope.distinct end def collection |
