aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorTeddy Wing2017-11-09 11:49:32 +0100
committercedricnjanga2017-11-13 17:52:54 +0100
commit08bb5790c7637e338700ae7f8100770a4d1c9d6e (patch)
treebe57f3d51f2b6cd99a1f4f119c3ba20b2b7ab648 /app/models
parent8602bf7a265f32fc84f609eca790c9a76a723be0 (diff)
downloadchouette-core-08bb5790c7637e338700ae7f8100770a4d1c9d6e.tar.bz2
ComplianceCheckSet#update_status: Return result of `#update`
We should return the result of the `ActiveRecord` `#update` call, so that we can determine if there was an error saving the `ComplianceCheckSet` record. Refs #4757
Diffstat (limited to 'app/models')
-rw-r--r--app/models/compliance_check_set.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/models/compliance_check_set.rb b/app/models/compliance_check_set.rb
index 062c5f4a4..d2155cb9a 100644
--- a/app/models/compliance_check_set.rb
+++ b/app/models/compliance_check_set.rb
@@ -22,18 +22,16 @@ class ComplianceCheckSet < ActiveRecord::Base
statuses = compliance_check_resources.map do |resource|
case resource.status
when 'ERROR'
- update(status: 'failed')
- return
+ return update(status: 'failed')
when 'WARNING'
- update(status: 'warning')
- return
+ return update(status: 'warning')
else
resource.status
end
end
if all_statuses_are_ok(statuses)
- update(status: 'successful')
+ return update(status: 'successful')
end
end