diff --git a/app/models/local_stage.rb b/app/models/local_stage.rb new file mode 100644 index 00000000..7d7cf42c --- /dev/null +++ b/app/models/local_stage.rb @@ -0,0 +1,3 @@ +class LocalStage < ActiveRecord::Base + attr_accessible :description, :local_subject_id, :name, :position, :shixuns_count, :subject_id +end diff --git a/app/models/local_stage_shixun.rb b/app/models/local_stage_shixun.rb new file mode 100644 index 00000000..66e79382 --- /dev/null +++ b/app/models/local_stage_shixun.rb @@ -0,0 +1,3 @@ +class LocalStageShixun < ActiveRecord::Base + attr_accessible :local_subject_id, :position, :shixun_id, :stage_id, :subject_id +end diff --git a/app/models/local_subject.rb b/app/models/local_subject.rb new file mode 100644 index 00000000..2aedcd44 --- /dev/null +++ b/app/models/local_subject.rb @@ -0,0 +1,3 @@ +class LocalSubject < ActiveRecord::Base + attr_accessible :description, :introduction, :learning_notes, :name, :shixuns_count, :stage_shixuns_count, :stages_count, :status +end diff --git a/db/migrate/20190924070347_create_local_subjects.rb b/db/migrate/20190924070347_create_local_subjects.rb new file mode 100644 index 00000000..db8087d3 --- /dev/null +++ b/db/migrate/20190924070347_create_local_subjects.rb @@ -0,0 +1,17 @@ +class CreateLocalSubjects < ActiveRecord::Migration + def change + create_table :local_subjects do |t| + t.string :name + t.text :description + t.integer :status + t.text :learning_notes + t.string :introduction + t.integer :stages_count + t.integer :stage_shixuns_count + t.integer :shixuns_count + t.integer :subject_id + + t.timestamps + end + end +end diff --git a/db/migrate/20190924072232_create_local_stages.rb b/db/migrate/20190924072232_create_local_stages.rb new file mode 100644 index 00000000..309a30e1 --- /dev/null +++ b/db/migrate/20190924072232_create_local_stages.rb @@ -0,0 +1,14 @@ +class CreateLocalStages < ActiveRecord::Migration + def change + create_table :local_stages do |t| + t.integer :subject_id + t.string :name + t.text :description + t.integer :position + t.integer :shixuns_count + t.integer :local_subject_id + + t.timestamps + end + end +end diff --git a/db/migrate/20190924072622_create_local_stage_shixuns.rb b/db/migrate/20190924072622_create_local_stage_shixuns.rb new file mode 100644 index 00000000..93c1d5da --- /dev/null +++ b/db/migrate/20190924072622_create_local_stage_shixuns.rb @@ -0,0 +1,15 @@ +class CreateLocalStageShixuns < ActiveRecord::Migration + def change + create_table :local_stage_shixuns do |t| + t.integer :subject_id + t.integer :local_subject_id + t.integer :stage_id + t.integer :local_stage_id + t.integer :shixun_id + t.integer :local_shixun_id + t.integer :position + + t.timestamps + end + end +end diff --git a/spec/factories/local_stage_shixuns.rb b/spec/factories/local_stage_shixuns.rb new file mode 100644 index 00000000..b4a361ee --- /dev/null +++ b/spec/factories/local_stage_shixuns.rb @@ -0,0 +1,9 @@ +FactoryGirl.define do + factory :local_stage_shixun do + subject_id 1 + local_subject_id 1 + stage_id 1 + shixun_id 1 + position 1 + end +end diff --git a/spec/factories/local_stages.rb b/spec/factories/local_stages.rb new file mode 100644 index 00000000..17b31ebc --- /dev/null +++ b/spec/factories/local_stages.rb @@ -0,0 +1,10 @@ +FactoryGirl.define do + factory :local_stage do + subject_id 1 + name "MyString" + description "MyText" + position 1 + shixuns_count 1 + local_subject_id 1 + end +end diff --git a/spec/factories/local_subjects.rb b/spec/factories/local_subjects.rb new file mode 100644 index 00000000..6b8ae8ee --- /dev/null +++ b/spec/factories/local_subjects.rb @@ -0,0 +1,12 @@ +FactoryGirl.define do + factory :local_subject do + name "MyString" + description "MyText" + status 1 + learning_notes "MyText" + introduction "MyString" + stages_count 1 + stage_shixuns_count 1 + shixuns_count 1 + end +end diff --git a/spec/models/local_stage_shixun_spec.rb b/spec/models/local_stage_shixun_spec.rb new file mode 100644 index 00000000..1bdc1bf5 --- /dev/null +++ b/spec/models/local_stage_shixun_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe LocalStageShixun, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/local_stage_spec.rb b/spec/models/local_stage_spec.rb new file mode 100644 index 00000000..78daf42a --- /dev/null +++ b/spec/models/local_stage_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe LocalStage, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/local_subject_spec.rb b/spec/models/local_subject_spec.rb new file mode 100644 index 00000000..cd0df666 --- /dev/null +++ b/spec/models/local_subject_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe LocalSubject, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end