aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorcedricnjanga2017-09-27 16:08:19 +0200
committercedricnjanga2017-09-27 16:23:22 +0200
commit5911206bbadb2c3c9609f8be0ce1affd6584015e (patch)
treed0b70454259fd985f1f6b6d0bbcd5616055fac83 /app/models
parenteb761e221efc3ce0b09bfea96415907afac33d4a (diff)
downloadchouette-core-5911206bbadb2c3c9609f8be0ce1affd6584015e.tar.bz2
Refs #4615 Change spec and controller regarding to the ComplianceControl models changes
Diffstat (limited to 'app/models')
-rw-r--r--app/models/compliance_control.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/compliance_control.rb b/app/models/compliance_control.rb
index 9c3083695..c5389e832 100644
--- a/app/models/compliance_control.rb
+++ b/app/models/compliance_control.rb
@@ -29,10 +29,10 @@ class ComplianceControl < ActiveRecord::Base
end
before_validation(on: :create) do
- self.name = self.class.name
- self.code = @@default_code
- self.origin_code = @@default_code
- self.criticity = @@default_criticity
+ self.name ||= self.class.name
+ self.code ||= @@default_code
+ self.origin_code ||= @@default_code
+ self.criticity ||= @@default_criticity
end
end