Add and apply Rails/WhereMissing rubocop rule
So now we know where to use the `where.missing` method which was introduced in Rails 6.1. Note this rule didn't detect all cases where the new method can be used.
This commit is contained in:
@@ -17,9 +17,9 @@ class Poll::Question::Answer < ApplicationRecord
|
||||
scope :with_content, -> { where.not(id: without_content) }
|
||||
scope :without_content, -> do
|
||||
where(description: "")
|
||||
.left_joins(:images).where(images: { id: nil })
|
||||
.left_joins(:documents).where(documents: { id: nil })
|
||||
.left_joins(:videos).where(poll_question_answer_videos: { id: nil })
|
||||
.where.missing(:images)
|
||||
.where.missing(:documents)
|
||||
.where.missing(:videos)
|
||||
end
|
||||
|
||||
def self.order_answers(ordered_array)
|
||||
|
||||
Reference in New Issue
Block a user