[go: up one dir, main page]

Skip to content

RuboCop: Create rule that requires to place BulkInsertSafe after any other concerns

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

As described in comment app/models/concerns/bulk_insert_safe.rb:19:

#   class MyRecord < ApplicationRecord
#     include BulkInsertSafe # must be included _last_ i.e. after any other concerns
#   end

to make this mixin works without issues we need to put it in the end of the concerns list. But why do we need to put such comment each time if we could write the cop that could keep an eye on it instead.

Involved components

app/models/**/*.rb that has include BulkInsertSafe inside. Currently it's a 10 models that will be covered by this cop. Some of them doesn't have this mixin in appropriate place. Hopefully it won't be a problem to just move it down the list.

Edited by 🤖 GitLab Bot 🤖