[openstreetmap/openstreetmap-website] Use implicit style for associations with factory overrides (PR #4232)

Andy Allan notifications at github.com
Wed Sep 6 09:28:57 UTC 2023


This matches our usage of implicit style for associations generally, e.g. `user`.

This isn't currently picked up by rubocop-factory_bot, due to a bug with the [default include paths](https://github.com/rubocop/rubocop-factory_bot/issues/53). Until the fix is released we can use the rubocop configuration to include our factories in the cop.

While working with upstream [on a fix](https://github.com/rubocop/rubocop-factory_bot/pull/55), I realised I didn't like the output of the autocorrect. So since this change will need some manual input eventually, I thought I'd just do it sooner rather than later. 

(The autocorrect goes from `association :author, :factory => :user` to `author :factory => [:user]` but in our case there's no need for the array).
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4232

-- Commit Summary --

  * Use implicit style for associations with factory overrides

-- File Changes --

    M .rubocop.yml (5)
    M test/factories/changeset_comments.rb (2)
    M test/factories/friendships.rb (4)
    M test/factories/issues.rb (4)
    M test/factories/messages.rb (4)
    M test/factories/oauth_access_grant.rb (4)
    M test/factories/oauth_access_token.rb (2)
    M test/factories/oauth_applications.rb (2)
    M test/factories/old_node.rb (2)
    M test/factories/old_relation.rb (2)
    M test/factories/old_relation_member.rb (2)
    M test/factories/old_way.rb (2)
    M test/factories/relation_member.rb (2)
    M test/factories/user_blocks.rb (4)
    M test/factories/user_role.rb (2)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4232.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4232.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4232
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4232 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230906/d5b6c281/attachment.htm>


More information about the rails-dev mailing list