From 7d4c4a4494ea04173383768406052e38d22c1917 Mon Sep 17 00:00:00 2001 From: Karol Date: Mon, 16 Dec 2019 17:43:47 +0100 Subject: [PATCH] remove checksum --- app/services/proforma_service/convert_exercise_to_task.rb | 3 +-- app/services/proforma_service/convert_task_to_exercise.rb | 3 +-- .../20190905152630_add_import_checksum_to_exercises.rb | 5 ----- db/schema.rb | 1 - .../proforma_service/convert_exercise_to_task_spec.rb | 3 +-- .../proforma_service/convert_task_to_exercise_spec.rb | 4 +--- spec/support/expectations/equal_exercise.rb | 2 +- 7 files changed, 5 insertions(+), 16 deletions(-) delete mode 100644 db/migrate/20190905152630_add_import_checksum_to_exercises.rb diff --git a/app/services/proforma_service/convert_exercise_to_task.rb b/app/services/proforma_service/convert_exercise_to_task.rb index 27836f91..b628b04d 100644 --- a/app/services/proforma_service/convert_exercise_to_task.rb +++ b/app/services/proforma_service/convert_exercise_to_task.rb @@ -26,8 +26,7 @@ module ProformaService tests: tests, uuid: uuid, language: DEFAULT_LANGUAGE, - model_solutions: model_solutions, - import_checksum: @exercise.import_checksum + model_solutions: model_solutions }.compact ) end diff --git a/app/services/proforma_service/convert_task_to_exercise.rb b/app/services/proforma_service/convert_task_to_exercise.rb index 6cb89a2c..7f49fa40 100644 --- a/app/services/proforma_service/convert_task_to_exercise.rb +++ b/app/services/proforma_service/convert_task_to_exercise.rb @@ -21,8 +21,7 @@ module ProformaService title: @task.title, description: @task.description, instructions: @task.internal_description, - files: files, - import_checksum: @task.checksum + files: files ) end diff --git a/db/migrate/20190905152630_add_import_checksum_to_exercises.rb b/db/migrate/20190905152630_add_import_checksum_to_exercises.rb deleted file mode 100644 index 26a5d365..00000000 --- a/db/migrate/20190905152630_add_import_checksum_to_exercises.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddImportChecksumToExercises < ActiveRecord::Migration[5.2] - def change - add_column :exercises, :import_checksum, :string - end -end diff --git a/db/schema.rb b/db/schema.rb index fcd4e86b..5c3ffdf7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -153,7 +153,6 @@ ActiveRecord::Schema.define(version: 2019_10_08_163045) do t.boolean "allow_auto_completion", default: false t.integer "expected_difficulty", default: 1 t.uuid "uuid" - t.string "import_checksum" t.boolean "unpublished", default: false t.index ["id"], name: "index_exercises_on_id" end diff --git a/spec/services/proforma_service/convert_exercise_to_task_spec.rb b/spec/services/proforma_service/convert_exercise_to_task_spec.rb index ae2976d1..f6fe6b7d 100644 --- a/spec/services/proforma_service/convert_exercise_to_task_spec.rb +++ b/spec/services/proforma_service/convert_exercise_to_task_spec.rb @@ -40,8 +40,7 @@ RSpec.describe ProformaService::ConvertExerciseToTask do # parent_uuid: exercise.clone_relations.first&.origin&.uuid, files: [], tests: [], - model_solutions: [], - import_checksum: exercise.import_checksum + model_solutions: [] ) end diff --git a/spec/services/proforma_service/convert_task_to_exercise_spec.rb b/spec/services/proforma_service/convert_task_to_exercise_spec.rb index 1d66d32f..ad41de3e 100644 --- a/spec/services/proforma_service/convert_task_to_exercise_spec.rb +++ b/spec/services/proforma_service/convert_task_to_exercise_spec.rb @@ -39,9 +39,7 @@ describe ProformaService::ConvertTaskToExercise do language: 'language', model_solutions: model_solutions, files: files, - tests: tests, - import_checksum: 'import_checksum', - checksum: 'checksum' + tests: tests ) end let(:user) { FactoryBot.create(:teacher) } diff --git a/spec/support/expectations/equal_exercise.rb b/spec/support/expectations/equal_exercise.rb index df21ec3d..8f72955c 100644 --- a/spec/support/expectations/equal_exercise.rb +++ b/spec/support/expectations/equal_exercise.rb @@ -37,6 +37,6 @@ RSpec::Matchers.define :be_an_equal_exercise_as do |exercise| def attributes_and_associations(object) object.attributes.dup.tap do |attributes| attributes[:files] = object.files if defined? object.files - end.except('id', 'created_at', 'updated_at', 'exercise_id', 'uuid', 'import_checksum') + end.except('id', 'created_at', 'updated_at', 'exercise_id', 'uuid') end end