aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorTeddy Wing2017-11-09 11:44:28 +0100
committercedricnjanga2017-11-13 17:52:54 +0100
commit406726c7d9f1d98a36e263c57a1fa361003cface (patch)
tree16b882fc4ef2e61d31166aa279f174ab604900ab /app/models
parentbde146b6ca9169c9724ed1406cfb6d1ec98f18f9 (diff)
downloadchouette-core-406726c7d9f1d98a36e263c57a1fa361003cface.tar.bz2
ComplianceCheckSet#update_status: Should return a boolean
Ensure that `#update_status` always returns a boolean value. We'll be using this to determine whether the updated status was 'successful' or not. Hmmm. Wait. That's not right. We want to return true from the update, we don't care about the status. The error case should be when the `update` fails. Darn. Refs #4757
Diffstat (limited to 'app/models')
-rw-r--r--app/models/compliance_check_set.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/models/compliance_check_set.rb b/app/models/compliance_check_set.rb
index 062c5f4a4..66ef6822e 100644
--- a/app/models/compliance_check_set.rb
+++ b/app/models/compliance_check_set.rb
@@ -23,10 +23,12 @@ class ComplianceCheckSet < ActiveRecord::Base
case resource.status
when 'ERROR'
update(status: 'failed')
- return
+
+ return false
when 'WARNING'
update(status: 'warning')
- return
+
+ return false
else
resource.status
end
@@ -34,7 +36,11 @@ class ComplianceCheckSet < ActiveRecord::Base
if all_statuses_are_ok(statuses)
update(status: 'successful')
+
+ return true
end
+
+ false
end
private