I have an action like
@documents = Document.all.includes(:user, user: :skills, user: :profession)
When I run rubocop on my controller, I get this result:
controllers/documents_controller.rb:4:75: W: Lint/DuplicatedKey: Duplicated key in hash literal.
@documents = Document.all.includes(:user, user: :skills, user: :profession)
^^^^
How can I solve this problem?
Here is a way:
Document.all.includes(:user, { user: [:skills, :profession] })