You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This defines user to be a hash with the key :strategy and the value :create, instead of an association to a User model that is created. This is not equivalent to association :user, strategy: :create.
Instead, should we be autocorrecting this code to the following?
Consider the following file:
This triggers a
FactoryBot/AssociationStyle
offense.When I run
rubocop -A
on the file, I see:The resulting file is:
This defines
user
to be a hash with the key:strategy
and the value:create
, instead of an association to aUser
model that is created. This is not equivalent toassociation :user, strategy: :create
.Instead, should we be autocorrecting this code to the following?
Or should we not trigger an offense at all?
Here is my
.rubocop.yml
:I am using
rubocop
1.57.1 andrubocop-factory_bot
2.24.0.The text was updated successfully, but these errors were encountered: