From b2d587fb2be60dee1dff5b592b197ef25600cea5 Mon Sep 17 00:00:00 2001 From: Splines <37160523+Splines@users.noreply.github.com> Date: Tue, 13 Aug 2024 20:02:04 +0200 Subject: [PATCH] Autocorrect rubocop "where range" (#675) --- app/models/assignment.rb | 4 ++-- app/models/medium.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/assignment.rb b/app/models/assignment.rb index 40f143d54..2b2792828 100644 --- a/app/models/assignment.rb +++ b/app/models/assignment.rb @@ -20,9 +20,9 @@ def deletion_date_cannot_be_in_the_past "in_past")) end - scope :active, -> { where("deadline >= ?", Time.zone.now) } + scope :active, -> { where(deadline: Time.zone.now..) } - scope :expired, -> { where("deadline < ?", Time.zone.now) } + scope :expired, -> { where(deadline: ...Time.zone.now) } def self.accepted_file_types [".pdf", ".tar.gz", ".cc", ".hh", ".m", ".mlx", ".zip"] diff --git a/app/models/medium.rb b/app/models/medium.rb index a2e9e2b5e..ab667c7cb 100644 --- a/app/models/medium.rb +++ b/app/models/medium.rb @@ -121,7 +121,7 @@ class Medium < ApplicationRecord } scope :proper, -> { where.not(sort: "RandomQuiz") } scope :expired, lambda { - where(sort: "RandomQuiz").where("created_at < ?", 1.day.ago) + where(sort: "RandomQuiz").where(created_at: ...1.day.ago) } searchable do