Merge pull request #5421 from consuldemocracy/rails6.1_rubocop_rules
Add rubocop rules affecting Rails 6.1
This commit is contained in:
@@ -377,6 +377,9 @@ Rails/CreateTableWithTimestamps:
|
|||||||
Rails/Date:
|
Rails/Date:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Rails/DeprecatedActiveModelErrorsMethods: # TODO: Remove after upgrading to Rails 7
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Rails/DurationArithmetic:
|
Rails/DurationArithmetic:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
@@ -507,6 +510,9 @@ Rails/Validation:
|
|||||||
Rails/WhereEquals:
|
Rails/WhereEquals:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Rails/WhereMissing:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Rails/WhereNot:
|
Rails/WhereNot:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ module SDG::Relatable
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pending_sdg_review
|
def pending_sdg_review
|
||||||
left_joins(:sdg_review).merge(SDG::Review.where(id: nil))
|
where.missing(:sdg_review)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ class Poll::Question::Answer < ApplicationRecord
|
|||||||
scope :with_content, -> { where.not(id: without_content) }
|
scope :with_content, -> { where.not(id: without_content) }
|
||||||
scope :without_content, -> do
|
scope :without_content, -> do
|
||||||
where(description: "")
|
where(description: "")
|
||||||
.left_joins(:images).where(images: { id: nil })
|
.where.missing(:images)
|
||||||
.left_joins(:documents).where(documents: { id: nil })
|
.where.missing(:documents)
|
||||||
.left_joins(:videos).where(poll_question_answer_videos: { id: nil })
|
.where.missing(:videos)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.order_answers(ordered_array)
|
def self.order_answers(ordered_array)
|
||||||
|
|||||||
Reference in New Issue
Block a user