diff options
| author | Teddy Wing | 2017-11-09 11:49:32 +0100 |
|---|---|---|
| committer | cedricnjanga | 2017-11-13 17:52:54 +0100 |
| commit | 08bb5790c7637e338700ae7f8100770a4d1c9d6e (patch) | |
| tree | be57f3d51f2b6cd99a1f4f119c3ba20b2b7ab648 /app/models | |
| parent | 8602bf7a265f32fc84f609eca790c9a76a723be0 (diff) | |
| download | chouette-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.rb | 8 |
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 |
