diff --git a/app/models/educational_stage.rb b/app/models/educational_stage.rb new file mode 100644 index 0000000000000000000000000000000000000000..ce78b7575f1114351ff873f698f2a9e91d69536c --- /dev/null +++ b/app/models/educational_stage.rb @@ -0,0 +1,2 @@ +class EducationalStage < ApplicationRecord +end diff --git a/app/models/subject.rb b/app/models/subject.rb new file mode 100644 index 0000000000000000000000000000000000000000..8857c6eb506fa8217503933673b83ef85b332875 --- /dev/null +++ b/app/models/subject.rb @@ -0,0 +1,2 @@ +class Subject < ApplicationRecord +end diff --git a/db/migrate/20161024160053_create_subjects.rb b/db/migrate/20161024160053_create_subjects.rb new file mode 100644 index 0000000000000000000000000000000000000000..86aac891c648abc64427616c0e66ea07970c0923 --- /dev/null +++ b/db/migrate/20161024160053_create_subjects.rb @@ -0,0 +1,10 @@ +class CreateSubjects < ActiveRecord::Migration[5.0] + def change + create_table :subjects do |t| + t.string :name + + t.timestamps null: false + end + add_index :subjects, :name, unique: true + end +end diff --git a/db/migrate/20161024160126_create_educational_stages.rb b/db/migrate/20161024160126_create_educational_stages.rb new file mode 100644 index 0000000000000000000000000000000000000000..76fc0d48c775f2381fba673772f1c6657040b6ca --- /dev/null +++ b/db/migrate/20161024160126_create_educational_stages.rb @@ -0,0 +1,10 @@ +class CreateEducationalStages < ActiveRecord::Migration[5.0] + def change + create_table :educational_stages do |t| + t.string :name + + t.timestamps null:false + end + add_index :educational_stages,:name, unique: true + end +end diff --git a/db/seeds.rb b/db/seeds.rb index 0cc0d52f1cfe1fb6431d0d6a224dd5cbcd6cc298..785a3bb76dff904dad91bd36d3402903fc6dc368 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -26,3 +26,5 @@ require_relative 'seeds/licenses' require_relative 'seeds/object_types' require_relative 'seeds/ratings' require_relative 'seeds/scores' +require_relative 'seeds/subjects' +require_relative 'seeds/educational_stages' diff --git a/db/seeds/educational_stages.rb b/db/seeds/educational_stages.rb new file mode 100644 index 0000000000000000000000000000000000000000..412f4909d754a0c873fc0e6b801e24ce01c5974f --- /dev/null +++ b/db/seeds/educational_stages.rb @@ -0,0 +1,5 @@ +EducationalStage.create(name: 'Educação Infatil') +EducationalStage.create(name: 'Ensino Fundamental') +EducationalStage.create(name: 'Ensino Médio') +EducationalStage.create(name: 'Outros') + diff --git a/db/seeds/subjects.rb b/db/seeds/subjects.rb new file mode 100644 index 0000000000000000000000000000000000000000..792685b02b0dfa9c142eeae351475abae4c2e62c --- /dev/null +++ b/db/seeds/subjects.rb @@ -0,0 +1,17 @@ +Subject.create(name:'Arte') +Subject.create(name:'LÃngua Portuguesa') +Subject.create(name:'Biologia') +Subject.create(name:'Ciências da Natureza') +Subject.create(name:'Educação Especial') +Subject.create(name:'Educação FÃsica') +Subject.create(name:'Educação IndÃgena') +Subject.create(name:'Espanhol') +Subject.create(name:'Filosofia') +Subject.create(name:'FÃsica') +Subject.create(name:'Geografia') +Subject.create(name:'História') +Subject.create(name:'Inglês') +Subject.create(name:'Matemática') +Subject.create(name:'Português') +Subject.create(name:'QuÃmica') +Subject.create(name:'Sociologia') diff --git a/test/fixtures/create_educational_stages.yml b/test/fixtures/create_educational_stages.yml new file mode 100644 index 0000000000000000000000000000000000000000..56066c68af42f307f5780e9ac146e3651cea3979 --- /dev/null +++ b/test/fixtures/create_educational_stages.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + +two: + name: MyString diff --git a/test/fixtures/subjects.yml b/test/fixtures/subjects.yml new file mode 100644 index 0000000000000000000000000000000000000000..56066c68af42f307f5780e9ac146e3651cea3979 --- /dev/null +++ b/test/fixtures/subjects.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + +two: + name: MyString diff --git a/test/models/create_educational_stage_test.rb b/test/models/create_educational_stage_test.rb new file mode 100644 index 0000000000000000000000000000000000000000..3f53a64992b15cd83eecbf01347da94bdc8bf04e --- /dev/null +++ b/test/models/create_educational_stage_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class CreateEducationalStageTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/subject_test.rb b/test/models/subject_test.rb new file mode 100644 index 0000000000000000000000000000000000000000..d54e76f758ea59928ad5c1d8d014fddbaf3eb378 --- /dev/null +++ b/test/models/subject_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SubjectTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end