Skip to content

Commit d3a4f3e

Browse files
committed
Add Rubocop exclusions for Rolify stuff
Since adding Rolify, we are triggering two significant Rubocop offenses: - `has_and_belongs_to_many` is frowned upon in favor of `has_many :through`, but Rolify still uses the former. There have been many attempts to resolve this (see the Rolify issues and PRs) over the past decade, but none have fully landed. It’s beyond us to try and wrestle this into existence, so we’re going to make an exception and move on. - The HABTM join table has no timestamps, which is also frowned upon. We genuinely don’t care, however, and so are making an exception. Issue #299
1 parent f9a9cfd commit d3a4f3e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.rubocop.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ AllCops:
1919
# Join tables don't really need timestamps
2020
Rails/CreateTableWithTimestamps:
2121
Exclude:
22-
# - 'db/migrate/20180128231930_create_organizations_and_events.rb'
22+
- db/migrate/20220919194501_rolify_create_roles.rb
2323

2424
# Rails generates this file
2525
Style/BlockComments:
@@ -64,6 +64,10 @@ Rails/HasManyOrHasOneDependent:
6464

6565
Rails/HasAndBelongsToMany:
6666
Enabled: true
67+
Exclude:
68+
# Rolify uses HABTM. Despite a decade of the community attempting to implement
69+
# `has_many: through`, it still struggles mightily with it. Let's make an exception.
70+
- app/models/role.rb
6771

6872
Style/NumericPredicate:
6973
Enabled: true

0 commit comments

Comments
 (0)