Skip to content

Commit f3f4b71

Browse files
committed
rubocop: Rails/Delegate and Lint/CopDirectiveSyntax
Change-Id: Ie43783fe24d9f9eb0f12fa521d3db6308aeebb84 Reviewed-on: https://gerrit.instructure.com/c/analytics/+/370552 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Aaron Ogata <aogata@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com>
1 parent af27ad2 commit f3f4b71

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

lib/analytics/assignment_submission.rb

+2-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def recorded_at
4040
# if we expect a submission return submitted_at because canvas expects a
4141
# submission to be submitted.
4242
submitted_at
43-
elsif graded_at.nil? || (@submission.graded? && @submission.score == 0) # rubocop:disable Lint/DuplicateBranch https://github.com/rubocop/rubocop/issues/10153
43+
elsif graded_at.nil? || (@submission.graded? && @submission.score == 0) # rubocop:disable Lint/DuplicateBranch -- https://github.com/rubocop/rubocop/issues/10153
4444
# if graded_at is nil we know that due_at is in the future. We know it
4545
# must be in the future because @submission.missing? above would have
4646
# been true. With due_at in the future, means it has not been recorded yet.
@@ -100,9 +100,7 @@ def submitted_at
100100
@submission&.submitted_at
101101
end
102102

103-
def non_digital_submission?
104-
@assignment.non_digital_submission?
105-
end
103+
delegate :non_digital_submission?, to: :@assignment
106104

107105
private
108106

lib/analytics/rollups/score_buckets.rb

+2-6
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,9 @@ def index_for(value)
6969
((value / @bucket_size) + 0.5).floor
7070
end
7171

72-
def max
73-
@counter.max
74-
end
72+
delegate :max, to: :@counter
7573

76-
def min
77-
@counter.min
78-
end
74+
delegate :min, to: :@counter
7975

8076
def first_quartile
8177
@counter.quartiles[0]

0 commit comments

Comments
 (0)