diff options
| author | Teddy Wing | 2018-04-19 17:34:37 +0200 |
|---|---|---|
| committer | Johan Van Ryseghem | 2018-04-26 09:16:15 +0200 |
| commit | 9c0013324b3dddb00c70b663a031b4ecf10e92c7 (patch) | |
| tree | c7e00db88a32ae7467795157351d16a9d0569f74 /app/controllers | |
| parent | de3762e2db02f876bdd032c9e1afe716d3c25dde (diff) | |
| download | chouette-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.rb | 4 |
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! |
