diff options
| author | Xinhui | 2017-03-24 17:16:57 +0100 |
|---|---|---|
| committer | Xinhui | 2017-03-24 17:16:57 +0100 |
| commit | 6580da810148d4ff90f69a7581d07c6bd41c1809 (patch) | |
| tree | 03e5d0b82bfacef479fef71d55fcd2beabc1da80 /app/controllers | |
| parent | 8611cc5a73ec5033bd177e7999cf28174290b6ed (diff) | |
| parent | 2c21e6dbbd2ed85070ee1ebdd26ee97882f424dd (diff) | |
| download | chouette-core-6580da810148d4ff90f69a7581d07c6bd41c1809.tar.bz2 | |
Merge branch 'master' into staging
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/line_footnotes_controller.rb | 7 | ||||
| -rw-r--r-- | app/controllers/lines_controller.rb | 2 | ||||
| -rw-r--r-- | app/controllers/workbenches_controller.rb | 2 |
3 files changed, 4 insertions, 7 deletions
diff --git a/app/controllers/line_footnotes_controller.rb b/app/controllers/line_footnotes_controller.rb index 8f7a38512..7bc048731 100644 --- a/app/controllers/line_footnotes_controller.rb +++ b/app/controllers/line_footnotes_controller.rb @@ -1,15 +1,15 @@ -class LineFootnotesController < ChouetteController - defaults :resource_class => Chouette::Line, :instance_name => 'line' +class LineFootnotesController < BreadcrumbController + defaults :resource_class => Chouette::Line include PolicyChecker before_action :check_policy, only: [:edit, :update, :destroy] respond_to :json, :only => :show - belongs_to :referential def show show! do build_breadcrumb :show end + @footnotes = @line.footnotes end def edit @@ -37,7 +37,6 @@ class LineFootnotesController < ChouetteController def resource @referential = Referential.find params[:referential_id] @line = @referential.lines.find params[:line_id] - @footnotes = @line.footnotes end def line_params diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb index 1f5478eff..7eedaeb05 100644 --- a/app/controllers/lines_controller.rb +++ b/app/controllers/lines_controller.rb @@ -92,7 +92,7 @@ class LinesController < BreadcrumbController private def sort_column - (Chouette::Line.column_names + ['companies.name']).include?(params[:sort]) ? params[:sort] : 'number' + (Chouette::Line.column_names + ['companies.name', 'networks.name']).include?(params[:sort]) ? params[:sort] : 'number' end def sort_direction %w[asc desc].include?(params[:direction]) ? params[:direction] : 'asc' diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb index 7f108b266..58fd507d4 100644 --- a/app/controllers/workbenches_controller.rb +++ b/app/controllers/workbenches_controller.rb @@ -7,9 +7,7 @@ class WorkbenchesController < BreadcrumbController def show scope = params[:q] ? resource.all_referentials : resource.referentials.ready scope = ransack_associated_lines(scope) - @q = ransack_periode(scope).ransack(params[:q]) - @q.organisation_name_eq_any ||= current_organisation.name unless params[:q] @wbench_refs = sort_result(@q.result).paginate(page: params[:page], per_page: 30) show! do build_breadcrumb :show |
