diff options
| -rw-r--r-- | app/controllers/vehicle_journeys_controller.rb | 2 | ||||
| -rw-r--r-- | app/models/referential.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/vehicle_journeys_controller.rb b/app/controllers/vehicle_journeys_controller.rb index 9dbb3bc43..14795227c 100644 --- a/app/controllers/vehicle_journeys_controller.rb +++ b/app/controllers/vehicle_journeys_controller.rb @@ -154,7 +154,7 @@ class VehicleJourneysController < ChouetteController private def load_custom_fields - @custom_fields = current_workgroup&.custom_fields_definitions || {} + @custom_fields = referential.workgroup&.custom_fields_definitions || {} end def map_stop_points points diff --git a/app/models/referential.rb b/app/models/referential.rb index 509e0412f..09c2e7d34 100644 --- a/app/models/referential.rb +++ b/app/models/referential.rb @@ -51,7 +51,9 @@ class Referential < ActiveRecord::Base belongs_to :stop_area_referential validates_presence_of :stop_area_referential has_many :stop_areas, through: :stop_area_referential + belongs_to :workbench + delegate :workgroup, to: :workbench, allow_nil: true belongs_to :referential_suite |
