From 9b83abfc89b9b1bb1d55f8728ecf7d59ac971b99 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Thu, 28 Sep 2017 11:01:41 +0200 Subject: fix review for pull request --- app/controllers/compliance_check_sets_controller.rb | 13 +++++-------- app/views/compliance_check_sets/index.html.slim | 8 ++++---- 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'app') diff --git a/app/controllers/compliance_check_sets_controller.rb b/app/controllers/compliance_check_sets_controller.rb index 989db1aeb..7d964731d 100644 --- a/app/controllers/compliance_check_sets_controller.rb +++ b/app/controllers/compliance_check_sets_controller.rb @@ -10,17 +10,14 @@ class ComplianceCheckSetsController < BreadcrumbController scope = ransack_period @compliance_check_sets @q_for_form = scope.ransack(params[:q]) format.html { - @compliance_check_sets = decorate_compliance_check_sets(@q_for_form.result) + @compliance_check_sets = ModelDecorator.decorate( + @q_for_form.result, + with: ComplianceCheckSetDecorator + ) } end end - def decorate_compliance_check_sets(compliance_check_sets) - ModelDecorator.decorate( - compliance_check_sets, - with: ComplianceCheckSetDecorator - ) - end private @@ -44,7 +41,7 @@ class ComplianceCheckSetsController < BreadcrumbController return scope unless !!@begin_range && !!@end_range if @begin_range > @end_range - flash.now[:error] = t('imports.filters.error_period_filter') + flash.now[:error] = t('compliance_check_sets.filters.error_period_filter') else scope = scope.where_created_at_between(@begin_range, @end_range) end diff --git a/app/views/compliance_check_sets/index.html.slim b/app/views/compliance_check_sets/index.html.slim index e33905fce..3e9b05393 100644 --- a/app/views/compliance_check_sets/index.html.slim +++ b/app/views/compliance_check_sets/index.html.slim @@ -18,7 +18,7 @@ .col-lg-12 .select_table = table_builder_2 @compliance_check_sets, - [ \ + [ \ TableBuilderHelper::Column.new( \ key: :ref, \ attribute: 'referential_id' \ @@ -43,9 +43,9 @@ attribute: Proc.new{ |n| (n.compliance_control_set.name) if n.compliance_control_set} \ ), \ ], - sortable: true, - links: [:show], - cls: 'table has-filter has-search' + sortable: true, + links: [:show], + cls: 'table has-filter has-search' - unless @compliance_check_sets.any? .row.mt-xs .col-lg-12 -- cgit v1.2.3