Disable Rails/SkipsModelValidations
cop (#28712)
This commit is contained in:
parent
b5afbe0a61
commit
a2f02a0775
10 changed files with 12 additions and 46 deletions
|
@ -44,8 +44,8 @@ class BulkImport < ApplicationRecord
|
|||
|
||||
def self.progress!(bulk_import_id, imported: false)
|
||||
# Use `increment_counter` so that the incrementation is done atomically in the database
|
||||
BulkImport.increment_counter(:processed_items, bulk_import_id) # rubocop:disable Rails/SkipsModelValidations
|
||||
BulkImport.increment_counter(:imported_items, bulk_import_id) if imported # rubocop:disable Rails/SkipsModelValidations
|
||||
BulkImport.increment_counter(:processed_items, bulk_import_id)
|
||||
BulkImport.increment_counter(:imported_items, bulk_import_id) if imported
|
||||
|
||||
# Since the incrementation has been done atomically, concurrent access to `bulk_import` is now bening
|
||||
bulk_import = BulkImport.find(bulk_import_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue