From ccb20dc5c1efea2e5d0331026bc17d39dda3db11 Mon Sep 17 00:00:00 2001 From: Andrew Cain Date: Fri, 9 Aug 2024 16:10:44 +1000 Subject: [PATCH] fix: remove default from cmi_datamodel in test attempt --- app/models/test_attempt.rb | 2 +- db/migrate/20231205011842_create_test_attempts.rb | 2 +- db/schema.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/test_attempt.rb b/app/models/test_attempt.rb index 88d9761d0..ea5cb381b 100644 --- a/app/models/test_attempt.rb +++ b/app/models/test_attempt.rb @@ -63,7 +63,7 @@ def specific_permission_hash(role, perm_hash, _other) # t.float :score_scaled, default: 0 # scorm datamodel - # t.text :cmi_datamodel, default: "{}", null: false + # t.text :cmi_datamodel after_initialize if: :new_record? do self.attempted_time = Time.zone.now diff --git a/db/migrate/20231205011842_create_test_attempts.rb b/db/migrate/20231205011842_create_test_attempts.rb index 3f7004a81..c1a313eb2 100644 --- a/db/migrate/20231205011842_create_test_attempts.rb +++ b/db/migrate/20231205011842_create_test_attempts.rb @@ -7,7 +7,7 @@ def change t.boolean :completion_status, default: false t.boolean :success_status, default: false t.float :score_scaled, default: 0 - t.text :cmi_datamodel, default: "{}", null: false + t.text :cmi_datamodel end end end diff --git a/db/schema.rb b/db/schema.rb index 110e17b92..786065928 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -368,7 +368,7 @@ t.boolean "completion_status", default: false t.boolean "success_status", default: false t.float "score_scaled", default: 0.0 - t.text "cmi_datamodel", default: "{}", null: false + t.text "cmi_datamodel" t.index ["task_id"], name: "index_test_attempts_on_task_id" end