Skip to content

Commit 1cc5335

Browse files
MrSerthdependabot[bot]
authored andcommitted
Fix Rubocop offenses
1 parent 04acfef commit 1cc5335

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

app/controllers/concerns/redirect_behavior.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def redirect_to_user_feedback
7474

7575
def redirect_to_unsolved_rfc(own: false)
7676
# Set a message that informs the user that their own RFC should be closed or help in another RFC is greatly appreciated.
77-
flash[:notice] = I18n.t("exercises.editor.exercise_finished_redirect_to_#{own ? 'own_' : ''}rfc")
77+
flash[:notice] = I18n.t("exercises.editor.exercise_finished_redirect_to_#{'own_' if own}rfc")
7878
flash.keep(:notice)
7979

8080
# Increase counter 'times_featured' in rfc

app/controllers/external_users_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def working_time_query(tag = nil)
6060
filtered_submissions.created_at
6161
) AS foo
6262
) AS bar
63-
#{tag.nil? ? '' : " JOIN exercise_tags et ON et.exercise_id = bar.exercise_id AND #{ExternalUser.sanitize_sql(['et.tag_id = ?', tag])}"}
63+
#{" JOIN exercise_tags et ON et.exercise_id = bar.exercise_id AND #{ExternalUser.sanitize_sql(['et.tag_id = ?', tag])}" unless tag.nil?}
6464
GROUP BY contributor_id,
6565
bar.exercise_id;
6666
"

app/policies/application_policy.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ def author?
1616
end
1717
private :author?
1818

19-
def everyone
19+
def everyone # rubocop:disable Naming/PredicateMethod
2020
# As the ApplicationController forces to have any authorization, `everyone` here means `every user logged in`
2121
true
2222
end
2323
private :everyone
2424

25-
def no_one
25+
def no_one # rubocop:disable Naming/PredicateMethod
2626
false
2727
end
2828
private :no_one

app/views/execution_environments/statistics.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ h1 = @execution_environment
2626
td = us['average_score'].to_f.round(4)
2727
td = us['maximum_score'].to_f.round(2)
2828
td = us['stddev_score'].to_f.round(4)
29-
td = (us['percent_correct'].to_f || 0).round(4)
29+
td = us['percent_correct'].to_f.round(4)
3030
td = us['average_submission_count'].to_f.round(2)
3131
td = average_time
3232
td = stddev_time

lib/code_ocean/config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Config
55
attr_reader :path, :read
66

77
def initialize(filename, options = {})
8-
@path = Rails.root.join('config', "#{filename}.yml#{options[:erb] ? '.erb' : ''}")
8+
@path = Rails.root.join('config', "#{filename}.yml#{'.erb' if options[:erb]}")
99
@read = parse(options)
1010
end
1111

lib/runner/strategy/null.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def self.available_images
4545

4646
def self.config; end
4747

48-
def self.health
48+
def self.health # rubocop:disable Naming/PredicateMethod
4949
true
5050
end
5151

0 commit comments

Comments
 (0)