Rubocop (Rails/SaveBang
) linters create(my_dynamic_string.to_sym)
when using with dynamic first param
#1620
Labels
Rails/SaveBang
) linters create(my_dynamic_string.to_sym)
when using with dynamic first param
#1620
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 with
public_send
FactoryBot.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 😅
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
The text was updated successfully, but these errors were encountered: