aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorTeddy Wing2018-04-19 17:34:37 +0200
committerJohan Van Ryseghem2018-04-26 09:16:15 +0200
commit9c0013324b3dddb00c70b663a031b4ecf10e92c7 (patch)
treec7e00db88a32ae7467795157351d16a9d0569f74 /app/controllers
parentde3762e2db02f876bdd032c9e1afe716d3c25dde (diff)
downloadchouette-core-9c0013324b3dddb00c70b663a031b4ecf10e92c7.tar.bz2
ReferentialVehicleJourneys: Use display name in line filter drop-down
Previously we had been showing the `name` field for the initial value of an already selected line. However, that doesn't show all the information that's normally given in the drop-down options. We instead have to use the `#display_name` method to get the full display that people are used to seeing in the drop-down. This also means we can no longer `pluck`, as more fields are required to assemble the display name. Instead, just do a simple `find` for the record. Refs #5889
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/referential_vehicle_journeys_controller.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/controllers/referential_vehicle_journeys_controller.rb b/app/controllers/referential_vehicle_journeys_controller.rb
index c35a06087..14f7909b9 100644
--- a/app/controllers/referential_vehicle_journeys_controller.rb
+++ b/app/controllers/referential_vehicle_journeys_controller.rb
@@ -14,9 +14,7 @@ class ReferentialVehicleJourneysController < ChouetteController
def index
if params[:q] && params[:q][:route_line_id_eq].present?
- @filtered_line = Chouette::Line
- .select(:id, :name)
- .find(params[:q][:route_line_id_eq])
+ @filtered_line = Chouette::Line.find(params[:q][:route_line_id_eq])
end
index!