Prevent storing empty results

Fixes CODEOCEAN-HS
This commit is contained in:
Sebastian Serth
2023-02-16 23:55:42 +01:00
committed by Sebastian Serth
parent 46bd9142c7
commit e632f95060
2 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ class LinterCheckRun < ApplicationRecord
end
# Now, we store all check runs and skip validations (they are already done)
LinterCheckRun.insert_all!(validated_check_runs) # rubocop:disable Rails/SkipsModelValidations
LinterCheckRun.insert_all!(validated_check_runs) if validated_check_runs.present? # rubocop:disable Rails/SkipsModelValidations
end
private_class_method :validate_and_store!
end

View File

@ -94,7 +94,7 @@ class TestrunMessage < ApplicationRecord
end
# Now, we store all messages and skip validations (they are already done)
TestrunMessage.insert_all!(validated_messages) # rubocop:disable Rails/SkipsModelValidations
TestrunMessage.insert_all!(validated_messages) if validated_messages.present? # rubocop:disable Rails/SkipsModelValidations
end
private_class_method :validate_and_store!