diff options
| author | Zog | 2018-01-15 18:22:53 +0100 |
|---|---|---|
| committer | Zog | 2018-01-25 17:17:58 +0100 |
| commit | 936650bb189104bf9795e0a7e9b5b8044e59a652 (patch) | |
| tree | ebca427ef1127cde9d62dd902e521c2e9bec7507 /app/controllers/lines_controller.rb | |
| parent | aefa3a507239b57ebdfe9110f3c8c789da6bce26 (diff) | |
| download | chouette-core-936650bb189104bf9795e0a7e9b5b8044e59a652.tar.bz2 | |
Refs #5586 @2h; Refactor the whole thing
We now have a ModelDecorator and an "instance" decorator, all in the
same file, with the same API.
Diffstat (limited to 'app/controllers/lines_controller.rb')
| -rw-r--r-- | app/controllers/lines_controller.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb index 7041a3a26..10ecc7e9d 100644 --- a/app/controllers/lines_controller.rb +++ b/app/controllers/lines_controller.rb @@ -15,9 +15,8 @@ class LinesController < ChouetteController def index @hide_group_of_line = line_referential.group_of_lines.empty? index! do |format| - @lines = ModelDecorator.decorate( + @lines = LineDecorator.decorate( @lines, - with: LineDecorator, context: { line_referential: @line_referential, current_organisation: current_organisation @@ -69,9 +68,14 @@ class LinesController < ChouetteController respond_to do |format| format.json { render :json => filtered_lines_maps} end + end + def decorated_collection + @lines end + helper_method :decorated_collection + protected def filtered_lines_maps |
