diff options
| author | Luc Donnet | 2018-03-27 09:29:01 +0200 | 
|---|---|---|
| committer | GitHub | 2018-03-27 09:29:01 +0200 | 
| commit | 7e56064ec6dbb60d00453d39680c2fdd9a462011 (patch) | |
| tree | 10a2e97f89eaf9aad345fa7d986f1ccd6661c871 /app/helpers | |
| parent | b6124228b93680a797e4cd555ecff71a9889386d (diff) | |
| parent | 2cbae0fdcfaab4dca13e50755ca031610eb3eedd (diff) | |
| download | chouette-core-7e56064ec6dbb60d00453d39680c2fdd9a462011.tar.bz2 | |
Merge pull request #391 from af83/6177-compliance-control-metadatas
Refs #6177 Add control attributes to CC#show
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/compliance_controls_helper.rb | 11 | 
1 files changed, 11 insertions, 0 deletions
| diff --git a/app/helpers/compliance_controls_helper.rb b/app/helpers/compliance_controls_helper.rb index ba0c538c9..297ae3afa 100644 --- a/app/helpers/compliance_controls_helper.rb +++ b/app/helpers/compliance_controls_helper.rb @@ -8,4 +8,15 @@ module ComplianceControlsHelper      key, pattern = key_pattern      [t("compliance_controls.filters.subclasses.#{key}"), "-#{pattern}-"]    end + +  def compliance_control_metadatas(compliance_control) +    attributes = resource.class.dynamic_attributes +    attributes.push(*resource.control_attributes.keys) if resource.respond_to? :control_attributes + +    {}.tap do |hash| +      attributes.each do |attribute| +        hash[ComplianceControl.human_attribute_name(attribute)] = resource.send(attribute) +      end +    end +  end  end  | 
