parent
8ca1d3fe9a
commit
e2b4cf513e
@ -0,0 +1,3 @@
|
|||||||
|
class LocalStage < ActiveRecord::Base
|
||||||
|
attr_accessible :description, :local_subject_id, :name, :position, :shixuns_count, :subject_id
|
||||||
|
end
|
@ -0,0 +1,3 @@
|
|||||||
|
class LocalStageShixun < ActiveRecord::Base
|
||||||
|
attr_accessible :local_subject_id, :position, :shixun_id, :stage_id, :subject_id
|
||||||
|
end
|
@ -0,0 +1,3 @@
|
|||||||
|
class LocalSubject < ActiveRecord::Base
|
||||||
|
attr_accessible :description, :introduction, :learning_notes, :name, :shixuns_count, :stage_shixuns_count, :stages_count, :status
|
||||||
|
end
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -0,0 +1,5 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe LocalStageShixun, :type => :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe LocalStage, :type => :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe LocalSubject, :type => :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
Loading…
Reference in new issue