mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-02 02:11:33 +00:00
Merge pull request #11426 from mkllnk/style-has-many
Allow has_and_belongs_to_many to reduce code
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user