Apply Rails/HasAndBelongsToMany rubocop rule
We were using it everywhere except in one place.
This commit is contained in:
@@ -15,9 +15,6 @@ Performance/EndWith:
|
|||||||
Performance/StartWith:
|
Performance/StartWith:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Rails/HasAndBelongsToMany:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Rails/HasManyOrHasOneDependent:
|
Rails/HasManyOrHasOneDependent:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
@@ -206,6 +206,9 @@ Rails/FindEach:
|
|||||||
Rails/HttpPositionalArguments:
|
Rails/HttpPositionalArguments:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Rails/HasAndBelongsToMany:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Rails/InverseOf:
|
Rails/InverseOf:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
Exclude:
|
Exclude:
|
||||||
|
|||||||
4
app/models/geozones_poll.rb
Normal file
4
app/models/geozones_poll.rb
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
class GeozonesPoll < ApplicationRecord
|
||||||
|
belongs_to :geozone
|
||||||
|
belongs_to :poll
|
||||||
|
end
|
||||||
@@ -27,7 +27,8 @@ class Poll < ApplicationRecord
|
|||||||
has_many :comments, as: :commentable, inverse_of: :commentable
|
has_many :comments, as: :commentable, inverse_of: :commentable
|
||||||
has_many :ballot_sheets
|
has_many :ballot_sheets
|
||||||
|
|
||||||
has_and_belongs_to_many :geozones
|
has_many :geozones_polls
|
||||||
|
has_many :geozones, through: :geozones_polls
|
||||||
belongs_to :author, -> { with_hidden }, class_name: "User", inverse_of: :polls
|
belongs_to :author, -> { with_hidden }, class_name: "User", inverse_of: :polls
|
||||||
belongs_to :related, polymorphic: true
|
belongs_to :related, polymorphic: true
|
||||||
belongs_to :budget
|
belongs_to :budget
|
||||||
|
|||||||
Reference in New Issue
Block a user