aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/compliance_controls_controller.rb
diff options
context:
space:
mode:
authorcedricnjanga2018-05-16 23:40:23 -0700
committerJohan Van Ryseghem2018-05-31 14:10:09 +0200
commitab00694f49336a326d934ff0bd85b76e2e0a6c23 (patch)
treeef6e2e264f909d49c0ea991b21c45ac1307dfef5 /app/controllers/compliance_controls_controller.rb
parentcc4f4a0abff3eeef4af6091180777bf3a0de6746 (diff)
downloadchouette-core-ab00694f49336a326d934ff0bd85b76e2e0a6c23.tar.bz2
Refs #7057 Display ComplianceControl object type to CCSet#select_type & CCSet#show views
Diffstat (limited to 'app/controllers/compliance_controls_controller.rb')
-rw-r--r--app/controllers/compliance_controls_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/compliance_controls_controller.rb b/app/controllers/compliance_controls_controller.rb
index 7df922d01..a20602c63 100644
--- a/app/controllers/compliance_controls_controller.rb
+++ b/app/controllers/compliance_controls_controller.rb
@@ -5,7 +5,11 @@ class ComplianceControlsController < ChouetteController
actions :all, :except => [:index]
def select_type
- @sti_subclasses = ComplianceControl.subclasses.sort_by {|compliance_control| compliance_control.default_code}
+ @sti_subclasses = Hash.new
+
+ ComplianceControl.subclass_patterns.each do |key, value|
+ @sti_subclasses[key] = ComplianceControl.subclasses.select {|klass| klass.object_type == value}
+ end
end
def show