Apply manual rubocop fixes
This commit is contained in:
@@ -6,7 +6,7 @@ class AddPoolSizeToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
|
||||
reversible do |direction|
|
||||
direction.up do
|
||||
ExecutionEnvironment.update_all(pool_size: 0)
|
||||
ExecutionEnvironment.update(pool_size: 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -6,7 +6,7 @@ class AddMemoryLimitToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
|
||||
reversible do |direction|
|
||||
direction.up do
|
||||
ExecutionEnvironment.update_all(memory_limit: DockerClient::DEFAULT_MEMORY_LIMIT)
|
||||
ExecutionEnvironment.update(memory_limit: DockerClient::DEFAULT_MEMORY_LIMIT)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -6,7 +6,7 @@ class AddNetworkEnabledToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
|
||||
reversible do |direction|
|
||||
direction.up do
|
||||
ExecutionEnvironment.update_all(network_enabled: true)
|
||||
ExecutionEnvironment.update(network_enabled: true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -17,6 +17,6 @@ class CreateInterventions < ActiveRecord::Migration[4.2]
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
Intervention.createDefaultInterventions
|
||||
Intervention.create_default_interventions
|
||||
end
|
||||
end
|
||||
|
@@ -3,6 +3,6 @@
|
||||
class SetDefaultForRequestForCommentSolved < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
change_column_default :request_for_comments, :solved, false
|
||||
RequestForComment.where(solved: nil).update_all(solved: false)
|
||||
RequestForComment.where(solved: nil).update(solved: false)
|
||||
end
|
||||
end
|
||||
|
@@ -6,7 +6,7 @@ class AddCauseToTestruns < ActiveRecord::Migration[4.2]
|
||||
Testrun.reset_column_information
|
||||
Testrun.all.each do |testrun|
|
||||
if testrun.submission.nil?
|
||||
say_with_time "#{testrun.id} has no submission" do end
|
||||
say_with_time "#{testrun.id} has no submission"
|
||||
else
|
||||
testrun.cause = testrun.submission.cause
|
||||
testrun.save
|
||||
|
@@ -4,7 +4,7 @@ class AddReachedFullScoreToRequestForComment < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :request_for_comments, :full_score_reached, :boolean, default: false
|
||||
RequestForComment.find_each do |rfc|
|
||||
if rfc.submission.present? && rfc.submission.exercise.has_user_solved(rfc.user)
|
||||
if rfc.submission.present? && rfc.submission.exercise.solved_by?(rfc.user)
|
||||
rfc.full_score_reached = true
|
||||
rfc.save
|
||||
end
|
||||
|
@@ -6,6 +6,6 @@ class AddUserToProxyExercise < ActiveRecord::Migration[5.2]
|
||||
add_column :proxy_exercises, :public, :boolean, null: false, default: false
|
||||
|
||||
internal_user = InternalUser.find_by(id: 46) || InternalUser.first
|
||||
ProxyExercise.update_all(user_id: internal_user&.id || 1, user_type: internal_user.class.name)
|
||||
ProxyExercise.update(user_id: internal_user&.id || 1, user_type: internal_user.class.name)
|
||||
end
|
||||
end
|
||||
|
@@ -5,6 +5,6 @@ class AddUserTypeToRemoteEvaluationMappings < ActiveRecord::Migration[5.2]
|
||||
add_column :remote_evaluation_mappings, :user_type, :string
|
||||
# Update all existing records and set user_type to `ExternalUser` (safe way to prevent any function loss).
|
||||
# We are not using a default value here on intend to be in line with the other `user_type` columns
|
||||
RemoteEvaluationMapping.update_all(user_type: 'ExternalUser')
|
||||
RemoteEvaluationMapping.update(user_type: 'ExternalUser')
|
||||
end
|
||||
end
|
||||
|
@@ -21,7 +21,7 @@ class DropErrors < ActiveRecord::Migration[5.2]
|
||||
end
|
||||
|
||||
def change
|
||||
puts 'Migrating CodeOcean::Errors to StructuredErrors using RegEx. This might take a (long) while but will return.'
|
||||
Rails.logger.info 'Migrating CodeOcean::Errors to StructuredErrors using RegEx. This might take a (long) while but will return.'
|
||||
submissions_controller = SubmissionsController.new
|
||||
|
||||
# Iterate only over those Errors containing a message and submission_id
|
||||
|
@@ -6,8 +6,8 @@ class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
|
||||
if table_exists?(:active_storage_blobs) && !column_exists?(:active_storage_blobs, :service_name)
|
||||
add_column :active_storage_blobs, :service_name, :string
|
||||
|
||||
if configured_service = ActiveStorage::Blob.service.name
|
||||
ActiveStorage::Blob.unscoped.update_all(service_name: configured_service)
|
||||
if (configured_service = ActiveStorage::Blob.service.name)
|
||||
ActiveStorage::Blob.unscoped.update(service_name: configured_service)
|
||||
end
|
||||
|
||||
change_column :active_storage_blobs, :service_name, :string, null: false
|
||||
|
Reference in New Issue
Block a user