From 5d55720aad206a58f9843ca729ce46d1387ac9dd Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Thu, 11 May 2017 15:56:33 +0200 Subject: [PATCH] Fix steps ordering in reports [SCI-1008] --- app/models/protocol.rb | 2 +- config/initializers/extends/report_extends.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/protocol.rb b/app/models/protocol.rb index dd10997a4..8f4049561 100644 --- a/app/models/protocol.rb +++ b/app/models/protocol.rb @@ -372,7 +372,7 @@ class Protocol < ActiveRecord::Base end def completed_steps - steps.select(&:completed) + steps.where(completed: true) end def space_taken diff --git a/config/initializers/extends/report_extends.rb b/config/initializers/extends/report_extends.rb index d243c6bb0..3245d8af0 100644 --- a/config/initializers/extends/report_extends.rb +++ b/config/initializers/extends/report_extends.rb @@ -52,7 +52,7 @@ module ReportExtends true, [:step], proc do |my_module| - my_module.protocol.completed_steps + my_module.protocol.completed_steps.order(:position) end), ModuleElement.new(:result_assets, true,