aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/compliance_control.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/models/compliance_control.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/models/compliance_control.rb')
-rw-r--r--app/models/compliance_control.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/compliance_control.rb b/app/models/compliance_control.rb
index 672fb128c..59c359bd5 100644
--- a/app/models/compliance_control.rb
+++ b/app/models/compliance_control.rb
@@ -20,6 +20,10 @@ class ComplianceControl < ApplicationModel
}
end
+ def object_type
+ self.default_code.match(/^\d+-(?'object_type'\w+)-\d+$/)[:object_type]
+ end
+
def inherited(child)
child.instance_eval do
def model_name