diff options
| -rw-r--r-- | app/decorators/referential_decorator.rb | 10 | 
1 files changed, 9 insertions, 1 deletions
| diff --git a/app/decorators/referential_decorator.rb b/app/decorators/referential_decorator.rb index 72f4706fe..9ebb6f330 100644 --- a/app/decorators/referential_decorator.rb +++ b/app/decorators/referential_decorator.rb @@ -5,7 +5,7 @@ class ReferentialDecorator < Draper::Decorator      policy = h.policy(object)      links = [] -    if h.has_feature?(:referential_vehicle_journeys) +    if has_feature?(:referential_vehicle_journeys)        links << Link.new(          content: h.t('referential_vehicle_journeys.index.title'),          href: h.referential_vehicle_journeys_path(object) @@ -70,4 +70,12 @@ class ReferentialDecorator < Draper::Decorator      links    end + +  private + +  # TODO move to a base Decorator (ApplicationDecorator) +  def has_feature?(*feature) +    h.has_feature?(*features) rescue false +  end +  end | 
