Skip to content

Commit

Permalink
Merge pull request #77 from alphagov/disable-rails-has-belongs
Browse files Browse the repository at this point in the history
Disable Rails/HasAndBelongsToMany
benthorner authored May 20, 2020
2 parents caca29a + 3cad9d8 commit 48e8572
Showing 3 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 3.12.0

- Disable Rails/HasAndBelongsToMany (#77)

# 3.11.0

- Add optional config for RSpec Cops (#75)
13 changes: 13 additions & 0 deletions config/rails.yml
Original file line number Diff line number Diff line change
@@ -27,3 +27,16 @@ Rails/Output:
Rails/SkipsModelValidations:
Blacklist:
- update_attribute

# While using has_many/through does have some advantages,
# it also requires a significant amount of boilerplate code:
#
# - An additional 'has_many :join_table' statement
# - An additional class for the join table (model)
#
# This Cop/rule appears to have been written with the
# assumption that all join tables have inherent meaning,
# we want to represent, which is not the case; sometimes
# relationships are just # many-to-many, and that's it.
Rails/HasAndBelongsToMany:
Enabled: false
2 changes: 1 addition & 1 deletion rubocop-govuk.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = "rubocop-govuk"
spec.version = "3.11.0"
spec.version = "3.12.0"
spec.authors = ["Government Digital Service"]
spec.email = ["govuk-dev@digital.cabinet-office.gov.uk"]

0 comments on commit 48e8572

Please sign in to comment.