Merge pull request #11426 from mkllnk/style-has-many

Allow has_and_belongs_to_many to reduce code
This commit is contained in:
David Cook
2023-08-24 15:03:17 +10:00
committed by GitHub
2 changed files with 7 additions and 13 deletions

View File

@@ -53,6 +53,13 @@ Rails/ApplicationRecord:
# Migrations should not contain application code:
- "db/migrate/*.rb"
# Allow many-to-many associations without explicit model.
# - It avoids the additional code of a model class.
# - It simplifies the declaration of the association.
# - Rails may know that there are no callbacks associated.
Rails/HasAndBelongsToMany:
Enabled: false
Rails/SkipsModelValidations:
AllowedMethods:
- "touch"

View File

@@ -418,19 +418,6 @@ Rails/ActiveRecordOverride:
Exclude:
- 'app/models/spree/product.rb'
# Offense count: 8
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasAndBelongsToMany:
Exclude:
- 'app/models/enterprise.rb'
- 'app/models/enterprise_group.rb'
- 'app/models/order_cycle.rb'
- 'app/models/spree/role.rb'
- 'app/models/spree/shipping_method.rb'
- 'app/models/spree/user.rb'
- 'app/models/spree/zone.rb'
# Offense count: 47
# Configuration parameters: Include.
# Include: app/models/**/*.rb