From 6567a517cf16f4e07bada8f1b0748d4bd4dc1e3d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 19 Dec 2019 16:36:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=98=E5=BA=93=E7=9A=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/curriculum.rb | 4 ---- app/models/curriculum_direction.rb | 4 ---- app/models/item_bank.rb | 2 -- app/models/knowledge_point.rb | 5 ----- app/models/knowledge_point_container.rb | 3 --- .../20191218070922_create_curriculum_directions.rb | 9 --------- db/migrate/20191218071017_create_curriculums.rb | 10 ---------- db/migrate/20191218071111_create_knowledge_points.rb | 11 ----------- ...191218071343_create_knowledge_point_containers.rb | 12 ------------ spec/models/curriculum_direction_spec.rb | 5 ----- spec/models/curriculum_spec.rb | 5 ----- spec/models/knowledge_point_container_spec.rb | 5 ----- spec/models/knowledge_point_spec.rb | 5 ----- 13 files changed, 80 deletions(-) delete mode 100644 app/models/curriculum.rb delete mode 100644 app/models/curriculum_direction.rb delete mode 100644 app/models/knowledge_point.rb delete mode 100644 app/models/knowledge_point_container.rb delete mode 100644 db/migrate/20191218070922_create_curriculum_directions.rb delete mode 100644 db/migrate/20191218071017_create_curriculums.rb delete mode 100644 db/migrate/20191218071111_create_knowledge_points.rb delete mode 100644 db/migrate/20191218071343_create_knowledge_point_containers.rb delete mode 100644 spec/models/curriculum_direction_spec.rb delete mode 100644 spec/models/curriculum_spec.rb delete mode 100644 spec/models/knowledge_point_container_spec.rb delete mode 100644 spec/models/knowledge_point_spec.rb diff --git a/app/models/curriculum.rb b/app/models/curriculum.rb deleted file mode 100644 index 0b78814bc..000000000 --- a/app/models/curriculum.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Curriculum < ApplicationRecord - belongs_to :curriculum_direction - has_many :knowledge_points, dependent: :destroy -end diff --git a/app/models/curriculum_direction.rb b/app/models/curriculum_direction.rb deleted file mode 100644 index 1c9211559..000000000 --- a/app/models/curriculum_direction.rb +++ /dev/null @@ -1,4 +0,0 @@ -class CurriculumDirection < ApplicationRecord - has_many :curriculums - has_many :knowledge_points -end diff --git a/app/models/item_bank.rb b/app/models/item_bank.rb index 32c349e34..8078a55e0 100644 --- a/app/models/item_bank.rb +++ b/app/models/item_bank.rb @@ -3,8 +3,6 @@ class ItemBank < ApplicationRecord # item_type: 0 单选 1 多选 2 判断 3 填空 4 简答 5 实训 6 编程 enum item_type: { SINGLE: 0, MULTIPLE: 1, JUDGMENT: 2, COMPLETION: 3, SUBJECTIVE: 4, PRACTICAL: 5, PROGRAM: 6 } - belongs_to :curriculum - belongs_to :curriculum_direction belongs_to :user has_one :item_analysis, dependent: :destroy diff --git a/app/models/knowledge_point.rb b/app/models/knowledge_point.rb deleted file mode 100644 index 3d75b66a1..000000000 --- a/app/models/knowledge_point.rb +++ /dev/null @@ -1,5 +0,0 @@ -class KnowledgePoint < ApplicationRecord - belongs_to :curriculum_direction - belongs_to :curriculum - has_many :knowledge_point_containers, dependent: :destroy -end diff --git a/app/models/knowledge_point_container.rb b/app/models/knowledge_point_container.rb deleted file mode 100644 index ea73d00e7..000000000 --- a/app/models/knowledge_point_container.rb +++ /dev/null @@ -1,3 +0,0 @@ -class KnowledgePointContainer < ApplicationRecord - belongs_to :knowledge_point -end diff --git a/db/migrate/20191218070922_create_curriculum_directions.rb b/db/migrate/20191218070922_create_curriculum_directions.rb deleted file mode 100644 index 9203aa435..000000000 --- a/db/migrate/20191218070922_create_curriculum_directions.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateCurriculumDirections < ActiveRecord::Migration[5.2] - def change - create_table :curriculum_directions do |t| - t.string :name - - t.timestamps - end - end -end diff --git a/db/migrate/20191218071017_create_curriculums.rb b/db/migrate/20191218071017_create_curriculums.rb deleted file mode 100644 index 885f2a676..000000000 --- a/db/migrate/20191218071017_create_curriculums.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateCurriculums < ActiveRecord::Migration[5.2] - def change - create_table :curriculums do |t| - t.string :name - t.references :curriculum_direction, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20191218071111_create_knowledge_points.rb b/db/migrate/20191218071111_create_knowledge_points.rb deleted file mode 100644 index 2f748d266..000000000 --- a/db/migrate/20191218071111_create_knowledge_points.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateKnowledgePoints < ActiveRecord::Migration[5.2] - def change - create_table :knowledge_points do |t| - t.string :name - t.references :curriculum_direction, index: true - t.references :curriculum, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20191218071343_create_knowledge_point_containers.rb b/db/migrate/20191218071343_create_knowledge_point_containers.rb deleted file mode 100644 index 0b6944ea7..000000000 --- a/db/migrate/20191218071343_create_knowledge_point_containers.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateKnowledgePointContainers < ActiveRecord::Migration[5.2] - def change - create_table :knowledge_point_containers do |t| - t.references :knowledge_point - t.integer :container_id - t.string :container_type - - t.timestamps - end - add_index :knowledge_point_containers, [:knowledge_point_id, :container_id, :container_type], name: "container_index", unique: true - end -end diff --git a/spec/models/curriculum_direction_spec.rb b/spec/models/curriculum_direction_spec.rb deleted file mode 100644 index 40cab64ca..000000000 --- a/spec/models/curriculum_direction_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe CurriculumDirection, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/curriculum_spec.rb b/spec/models/curriculum_spec.rb deleted file mode 100644 index b03089a91..000000000 --- a/spec/models/curriculum_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe Curriculum, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/knowledge_point_container_spec.rb b/spec/models/knowledge_point_container_spec.rb deleted file mode 100644 index 3e151062f..000000000 --- a/spec/models/knowledge_point_container_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe KnowledgePointContainer, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/knowledge_point_spec.rb b/spec/models/knowledge_point_spec.rb deleted file mode 100644 index d85138a0f..000000000 --- a/spec/models/knowledge_point_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe KnowledgePoint, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end