I apologies first if I'm not in the right place to ask/report.
I got the Rubocop Rails/SaveBang error triggered when I want to create FactoryBot object, using a dynamic value as first parameter.
See the Rubocop linter in the following
✅ Using with traitcreate(document_type, :my_trait)
✅ Using with public_sendFactoryBot.public_send(:create, document_type)
❌ Using only the dynamic first param create(document_type)
Is it like Rubocop think I'm working with ActiveRecord object 😅
Description
I apologies first if I'm not in the right place to ask/report.
I got the Rubocop
Rails/SaveBang
error triggered when I want to create FactoryBot object, using a dynamic value as first parameter. See the Rubocop linter in the following✅ Using with trait
create(document_type, :my_trait)
✅ Using withpublic_send
FactoryBot.public_send(:create, document_type)
❌ Using only the dynamic first paramcreate(document_type)
Is it like Rubocop think I'm working with ActiveRecord object 😅
Thank you very much in advance for your help 🙏🏼
Reproduction Steps
Written script :
Expected behavior
I would like Rubocop to not treat this as an ActiveRecord object (
user.create(...)
VS FactoryBotcreate(:user)
) And not linter my line.System configuration
factory_bot version: 6.4.5 rails version: 7.0.8 ruby version: 3.2.2