Add and apply FactoryBot/AssociationStyle rule

This rule was added in rubocop-factory_bot 2.23.0. We were following it
sometimes, and sometimes we were not.
This commit is contained in:
Javi Martín
2023-09-08 13:52:54 +02:00
parent b88a01f641
commit 614b4fbe4c
17 changed files with 77 additions and 74 deletions

View File

@@ -1,22 +1,22 @@
FactoryBot.define do
factory :notification do
user
association :notifiable, factory: :proposal
notifiable factory: :proposal
trait :read do
read_at { Time.current }
end
trait :for_proposal_notification do
association :notifiable, factory: :proposal_notification
notifiable factory: :proposal_notification
end
trait :for_comment do
association :notifiable, factory: :comment
notifiable factory: :comment
end
trait :for_poll_question do
association :notifiable, factory: :poll_question
notifiable factory: :poll_question
end
end