Apply automatic rubocop fixes
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class UserExerciseFeedback < ApplicationRecord
|
||||
include Creation
|
||||
|
||||
@ -5,17 +7,17 @@ class UserExerciseFeedback < ApplicationRecord
|
||||
belongs_to :submission, optional: true
|
||||
has_one :execution_environment, through: :exercise
|
||||
|
||||
validates :user_id, uniqueness: { scope: [:exercise_id, :user_type] }
|
||||
validates :user_id, uniqueness: {scope: %i[exercise_id user_type]}
|
||||
|
||||
scope :intermediate, -> { where.not(normalized_score: 1.00) }
|
||||
scope :final, -> { where(normalized_score: 1.00) }
|
||||
|
||||
def to_s
|
||||
"User Exercise Feedback"
|
||||
'User Exercise Feedback'
|
||||
end
|
||||
|
||||
def anomaly_notification
|
||||
AnomalyNotification.where({exercise_id: exercise.id, user_id: user_id, user_type: user_type})
|
||||
.where("created_at < ?", created_at).order("created_at DESC").to_a.first
|
||||
.where('created_at < ?', created_at).order('created_at DESC').to_a.first
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user