diff options
| author | cedricnjanga | 2018-05-16 23:40:23 -0700 |
|---|---|---|
| committer | Johan Van Ryseghem | 2018-05-31 14:10:09 +0200 |
| commit | ab00694f49336a326d934ff0bd85b76e2e0a6c23 (patch) | |
| tree | ef6e2e264f909d49c0ea991b21c45ac1307dfef5 /app/models/compliance_control.rb | |
| parent | cc4f4a0abff3eeef4af6091180777bf3a0de6746 (diff) | |
| download | chouette-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.rb | 4 |
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 |
