Skip to content

Commit

Permalink
quality: fix rubocop errors
Browse files Browse the repository at this point in the history
  • Loading branch information
macite committed Jan 1, 2024
1 parent 3a954c2 commit fb9e839
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
8 changes: 5 additions & 3 deletions app/api/entities/user_entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ class UserEntity < Grape::Entity
expose :has_run_first_time_setup, unless: :minimal

expose :accepted_tii_eula, unless: :minimal, if: ->(user, options) { Doubtfire::Application.config.tii_enabled } do |user, options|
return true unless TiiActionFetchFeaturesEnabled.eula_required?

TurnItIn.eula_version == user.tii_eula_version
if TiiActionFetchFeaturesEnabled.eula_required?
TurnItIn.eula_version == user.tii_eula_version
else
true
end
end

expose :system_role, unless: :minimal do |user, options|
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/turn_it_in.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def self.eula_html
# Check if an update of the eula is required, and update when needed
def self.check_and_update_eula
# Get or create the
eula_job = (TiiActionFetchEula.last || TiiActionFetchEula.create)
eula_job = TiiActionFetchEula.last || TiiActionFetchEula.create
eula_job.perform if eula_job.update_required?
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def ensure_no_submissions
def specific_permission_hash(role, perm_hash, _other)
result = perm_hash[role] unless perm_hash.nil?
if result && role == :student
result << :manage_group if (!locked && !group_set.locked && group_set.allow_students_to_manage_groups)
result << :manage_group if !locked && !group_set.locked && group_set.allow_students_to_manage_groups
end
result
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def convert_hash_to_pct(hash, total)
hash.each { |key, value| hash[key] = (hash[key] < 0.01 ? 0.0 : (value / total).signif(2)) }

total = 0.0
hash.each { |_key, value| total += value }
hash.each_value { |value| total += value }

if total != 1.0
dif = 1.0 - total
Expand Down
2 changes: 1 addition & 1 deletion app/models/turn_it_in/tii_action_upload_submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def request_similarity_report
data = TCAClient::SimilarityPutRequest.new(
indexing_settings:
TCAClient::IndexingSettings.new(
add_to_index: add_to_index,
add_to_index: add_to_index
),
generation_settings:
TCAClient::SimilarityGenerationSettings.new(
Expand Down
2 changes: 1 addition & 1 deletion app/models/unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ def update_student_enrolments(changes, import_settings, result)
ignored = result[:ignored]

# now apply the changes...
changes.each do |key, row_data|
changes.each_value do |row_data|
begin
row = row_data[:row]
username = row_data[:username].downcase
Expand Down
3 changes: 1 addition & 2 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
# Report errors to Sentry as warnings
Sentry.capture_exception exception, level: 'warning',
tags: { method: method, returning: returning }
}
}
} }

# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/checks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace :submission do
puts ' done.'
rescue => e
puts 'Failed with error'
puts e.message.to_s
puts e.message
ensure
end_executing_plagiarism
end
Expand Down

0 comments on commit fb9e839

Please sign in to comment.