yslnewtiku
parent
6753f5fee4
commit
fc441cde2f
@ -0,0 +1,6 @@
|
|||||||
|
class Admins::DisciplinesController < Admins::BaseController
|
||||||
|
|
||||||
|
def index
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,3 @@
|
|||||||
|
class Discipline < ApplicationRecord
|
||||||
|
has_many :sub_disciplines, dependent: :destroy
|
||||||
|
end
|
@ -1,4 +0,0 @@
|
|||||||
class ItemBankTagRepertoire < ApplicationRecord
|
|
||||||
belongs_to :item_bank
|
|
||||||
belongs_to :tag_repertoire
|
|
||||||
end
|
|
@ -0,0 +1,4 @@
|
|||||||
|
class SubDiscipline < ApplicationRecord
|
||||||
|
belongs_to :discipline
|
||||||
|
has_many :tag_disciplines, dependent: :destroy
|
||||||
|
end
|
@ -0,0 +1,3 @@
|
|||||||
|
class TagDiscipline < ApplicationRecord
|
||||||
|
belongs_to :sub_discipline
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class TagDisciplineContainer < ApplicationRecord
|
||||||
|
belongs_to :tag_discipline
|
||||||
|
|
||||||
|
belongs_to :container, polymorphic: true, optional: true
|
||||||
|
end
|
@ -1,10 +0,0 @@
|
|||||||
class CreateItemBankTagRepertoires < ActiveRecord::Migration[5.2]
|
|
||||||
def change
|
|
||||||
create_table :item_bank_tag_repertoires do |t|
|
|
||||||
t.references :item_bank, index: true
|
|
||||||
t.references :tag_repertoire, index: true
|
|
||||||
|
|
||||||
t.timestamps
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -0,0 +1,12 @@
|
|||||||
|
class CreateDisciplines < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
create_table :disciplines do |t|
|
||||||
|
t.string :name
|
||||||
|
t.boolean :subject
|
||||||
|
t.boolean :shixun
|
||||||
|
t.boolean :question
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,13 @@
|
|||||||
|
class CreateSubDisciplines < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
create_table :sub_disciplines do |t|
|
||||||
|
t.references :discipline, index: true
|
||||||
|
t.string :name
|
||||||
|
t.boolean :subject
|
||||||
|
t.boolean :shixun
|
||||||
|
t.boolean :question
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,13 @@
|
|||||||
|
class CreateTagDisciplines < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
create_table :tag_disciplines do |t|
|
||||||
|
t.references :sub_discipline, index: true
|
||||||
|
t.string :name
|
||||||
|
t.boolean :subject
|
||||||
|
t.boolean :shixun
|
||||||
|
t.boolean :question
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,6 @@
|
|||||||
|
class MigrateItemBankTagColumn < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
remove_column :item_banks, :sub_repertoire_id
|
||||||
|
add_column :item_banks, :sub_discipline_id, :integer, index: true
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,13 @@
|
|||||||
|
class CreateTagDisciplineContainers < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
create_table :tag_discipline_containers do |t|
|
||||||
|
t.references :tag_discipline, index: true
|
||||||
|
t.integer :container_id
|
||||||
|
t.string :container_type
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index :tag_discipline_containers, [:container_type, :container_id], name: "index_on_container"
|
||||||
|
end
|
||||||
|
end
|
@ -1,5 +1,5 @@
|
|||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
RSpec.describe ItemBankTagRepertoire, type: :model do
|
RSpec.describe Discipline, type: :model do
|
||||||
pending "add some examples to (or delete) #{__FILE__}"
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
end
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe SubDiscipline, type: :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe TagDisciplineContainer, type: :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe TagDiscipline, type: :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
Loading…
Reference in new issue