Fix rubocop offenses - Requires Ruby 3.1+

This commit is contained in:
Sebastian Serth
2022-11-25 10:53:14 +01:00
parent bdf474e684
commit 574e99eddd
93 changed files with 315 additions and 315 deletions

View File

@ -293,7 +293,7 @@ class MigrateTestruns < ActiveRecord::Migration[6.1]
# Using the string keys by design. Otherwise, we would need to call #symbolize_keys!
message = {
testrun: testrun,
testrun:,
cmd: json['cmd'],
# We cannot infer any timestamp and thus use arbitrary, distinct millisecond values (1s = 1000ms)
timestamp: ActiveSupport::Duration.build(order / 1000.0),

View File

@ -10,7 +10,7 @@ class MigratePermissionsToStudyGroup < ActiveRecord::Migration[6.1]
def create_default_groups
Consumer.find_each do |consumer|
StudyGroup.find_or_create_by!(consumer: consumer, external_id: nil) do |new_group|
StudyGroup.find_or_create_by!(consumer:, external_id: nil) do |new_group|
new_group.name = "Default Study Group for #{consumer.name}"
end
end
@ -25,7 +25,7 @@ class MigratePermissionsToStudyGroup < ActiveRecord::Migration[6.1]
# All platform admins will "just" be a teacher in the study group
new_role = %w[admin teacher].include?(user.role) ? :teacher : :learner
membership = StudyGroupMembership.find_or_create_by!(study_group: study_group, user: user)
membership = StudyGroupMembership.find_or_create_by!(study_group:, user:)
membership.update_columns(role: new_role)
end
end

View File

@ -13,7 +13,7 @@ passwords = ['password', 'password confirmation'].map do |attribute|
end
if passwords.uniq.length == 1
admin = FactoryBot.create(:admin, email: email, name: 'Administrator', password: passwords.first, study_groups: StudyGroup.all)
admin = FactoryBot.create(:admin, email:, name: 'Administrator', password: passwords.first, study_groups: StudyGroup.all)
else
abort('Passwords do not match!')
end