Skip to content

Fix Database/MultipleDatabases offenses fix [RUN AS-IF-FOSS]

Adam Hegyi requested to merge 335192-fix-ar-base-offenses into master

What does this MR do?

This change fixes a few Database/MultipleDatabases rubocop offenses and tries to reduce the transaction scope to specific model if possible. To keep the MR small, I'm doing the fixes in batches, so there will be at least one more MR.

Rules:

  • If transaction interacts with one model: use Model.transaction
  • If multiple models are involved and we're sure it's not CI related models: ApplicationRecord.transaction
  • If unsure, ignore the rubocop rule and collect track the items in this issue: #335808 (closed)

Screenshots or Screencasts (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #335192 (closed)

Edited by Adam Hegyi

Merge request reports