diff options
| author | cedricnjanga | 2018-04-18 06:52:44 -0700 | 
|---|---|---|
| committer | cedricnjanga | 2018-04-19 09:20:40 -0700 | 
| commit | 4d8e941017d8149c542bd5fe9e6b0a604c6c9cfe (patch) | |
| tree | f0d4a8214db3ffcfb94744fae106610fae3a3c62 /app/controllers | |
| parent | 7a7924fb0a29c05a49c830cef7ce85e35e32f716 (diff) | |
| download | chouette-core-4d8e941017d8149c542bd5fe9e6b0a604c6c9cfe.tar.bz2 | |
Refs #6574 Create decorators to handle sync actions for stop area referential and line referential6574-sync-actions-in-decorators
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/line_referentials_controller.rb | 6 | ||||
| -rw-r--r-- | app/controllers/stop_area_referentials_controller.rb | 7 | 
2 files changed, 13 insertions, 0 deletions
| diff --git a/app/controllers/line_referentials_controller.rb b/app/controllers/line_referentials_controller.rb index 03dab3f8f..e661fbb04 100644 --- a/app/controllers/line_referentials_controller.rb +++ b/app/controllers/line_referentials_controller.rb @@ -2,6 +2,12 @@ class LineReferentialsController < ChouetteController    defaults :resource_class => LineReferential +  def show +    show! do +      @line_referential = LineReferentialDecorator.decorate(@line_referential) +    end +  end +    def sync      authorize resource, :synchronize?      @sync = resource.line_referential_syncs.build diff --git a/app/controllers/stop_area_referentials_controller.rb b/app/controllers/stop_area_referentials_controller.rb index f2d375e49..0e6a54b49 100644 --- a/app/controllers/stop_area_referentials_controller.rb +++ b/app/controllers/stop_area_referentials_controller.rb @@ -1,6 +1,13 @@  class StopAreaReferentialsController < ChouetteController    defaults :resource_class => StopAreaReferential + +  def show +    show! do +      @stop_area_referential = StopAreaReferentialDecorator.decorate(@stop_area_referential) +    end +  end +    def sync      authorize resource, :synchronize?      @sync = resource.stop_area_referential_syncs.build | 
