aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Donnet2015-06-10 16:17:24 +0200
committerLuc Donnet2015-06-10 16:17:24 +0200
commit421cbd7e00f3c736b134ea5714352e48a74501a8 (patch)
tree4e54f01e9a5b1084bcbad8dd22f10ec0dce5b027
parent8de3f18adc6a8670cfc28d01629e1f3528dc3da8 (diff)
downloadchouette-core-421cbd7e00f3c736b134ea5714352e48a74501a8.tar.bz2
Fix order in import export and compliance_checks list with descending order on created_at
-rw-r--r--app/controllers/compliance_checks_controller.rb2
-rw-r--r--app/controllers/exports_controller.rb2
-rw-r--r--app/controllers/imports_controller.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/compliance_checks_controller.rb b/app/controllers/compliance_checks_controller.rb
index 9b29692c2..39ae397e6 100644
--- a/app/controllers/compliance_checks_controller.rb
+++ b/app/controllers/compliance_checks_controller.rb
@@ -76,7 +76,7 @@ class ComplianceChecksController < ChouetteController
end
def collection
- @compliance_checks ||= compliance_check_service.all.paginate(:page => params[:page])
+ @compliance_checks ||= compliance_check_service.all.sort_by{ |compliance_check| compliance_check.created_at }.reverse.paginate(:page => params[:page])
end
end
diff --git a/app/controllers/exports_controller.rb b/app/controllers/exports_controller.rb
index 80c70902e..d6e9cdf42 100644
--- a/app/controllers/exports_controller.rb
+++ b/app/controllers/exports_controller.rb
@@ -67,6 +67,6 @@ class ExportsController < ChouetteController
end
def collection
- @exports ||= export_service.all.paginate(:page => params[:page])
+ @exports ||= export_service.all.sort_by{ |export| export.created_at }.reverse.paginate(:page => params[:page])
end
end
diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb
index 2d4782d50..b3c04d51b 100644
--- a/app/controllers/imports_controller.rb
+++ b/app/controllers/imports_controller.rb
@@ -97,7 +97,7 @@ class ImportsController < ChouetteController
end
def collection
- @imports ||= import_service.all.paginate(:page => params[:page])
+ @imports ||= import_service.all.sort_by{ |import| import.created_at }.reverse.paginate(:page => params[:page])
end
end