diff options
| -rw-r--r-- | app/controllers/referential_vehicle_journeys_controller.rb | 2 | ||||
| -rw-r--r-- | app/decorators/referential_decorator.rb | 17 |
2 files changed, 14 insertions, 5 deletions
diff --git a/app/controllers/referential_vehicle_journeys_controller.rb b/app/controllers/referential_vehicle_journeys_controller.rb index 75e24fe33..ad08699a5 100644 --- a/app/controllers/referential_vehicle_journeys_controller.rb +++ b/app/controllers/referential_vehicle_journeys_controller.rb @@ -5,6 +5,8 @@ class ReferentialVehicleJourneysController < ChouetteController include ReferentialSupport defaults :resource_class => Chouette::VehicleJourney, collection_name: :vehicle_journeys + requires_feature :referential_vehicle_journeys + private def collection diff --git a/app/decorators/referential_decorator.rb b/app/decorators/referential_decorator.rb index 4103790aa..72f4706fe 100644 --- a/app/decorators/referential_decorator.rb +++ b/app/decorators/referential_decorator.rb @@ -3,12 +3,19 @@ class ReferentialDecorator < Draper::Decorator def action_links policy = h.policy(object) - links = [ - Link.new( - content: h.t('time_tables.index.title'), - href: h.referential_time_tables_path(object) + links = [] + + if h.has_feature?(:referential_vehicle_journeys) + links << Link.new( + content: h.t('referential_vehicle_journeys.index.title'), + href: h.referential_vehicle_journeys_path(object) ) - ] + end + + links << Link.new( + content: h.t('time_tables.index.title'), + href: h.referential_time_tables_path(object) + ) if policy.clone? links << Link.new( |
