diff --git a/app/controllers/pmdk_each_score_informations_controller.rb b/app/controllers/pmdk_each_score_informations_controller.rb new file mode 100644 index 0000000..f8fdc12 --- /dev/null +++ b/app/controllers/pmdk_each_score_informations_controller.rb @@ -0,0 +1,16 @@ +class PmdkEachScoreInformationsController < ApplicationController + def new + end + + def update + end + + def create + end + + def edit + end + + def show + end +end diff --git a/app/controllers/pmdk_school_informations_controller.rb b/app/controllers/pmdk_school_informations_controller.rb new file mode 100644 index 0000000..b490736 --- /dev/null +++ b/app/controllers/pmdk_school_informations_controller.rb @@ -0,0 +1,16 @@ +class PmdkSchoolInformationsController < ApplicationController + def new + end + + def update + end + + def create + end + + def edit + end + + def show + end +end diff --git a/app/controllers/pmdk_total_score_informations_controller.rb b/app/controllers/pmdk_total_score_informations_controller.rb new file mode 100644 index 0000000..add5cd2 --- /dev/null +++ b/app/controllers/pmdk_total_score_informations_controller.rb @@ -0,0 +1,16 @@ +class PmdkTotalScoreInformationsController < ApplicationController + def new + end + + def update + end + + def create + end + + def edit + end + + def show + end +end diff --git a/app/helpers/pmdk_each_score_informations_helper.rb b/app/helpers/pmdk_each_score_informations_helper.rb new file mode 100644 index 0000000..d65b3e6 --- /dev/null +++ b/app/helpers/pmdk_each_score_informations_helper.rb @@ -0,0 +1,2 @@ +module PmdkEachScoreInformationsHelper +end diff --git a/app/helpers/pmdk_school_informations_helper.rb b/app/helpers/pmdk_school_informations_helper.rb new file mode 100644 index 0000000..da8d758 --- /dev/null +++ b/app/helpers/pmdk_school_informations_helper.rb @@ -0,0 +1,2 @@ +module PmdkSchoolInformationsHelper +end diff --git a/app/helpers/pmdk_total_score_informations_helper.rb b/app/helpers/pmdk_total_score_informations_helper.rb new file mode 100644 index 0000000..ad43cbc --- /dev/null +++ b/app/helpers/pmdk_total_score_informations_helper.rb @@ -0,0 +1,2 @@ +module PmdkTotalScoreInformationsHelper +end diff --git a/app/models/pmdk_each_score_information.rb b/app/models/pmdk_each_score_information.rb new file mode 100644 index 0000000..ead7174 --- /dev/null +++ b/app/models/pmdk_each_score_information.rb @@ -0,0 +1,3 @@ +class PmdkEachScoreInformation < ApplicationRecord + belongs_to :user +end diff --git a/app/models/pmdk_school_information.rb b/app/models/pmdk_school_information.rb new file mode 100644 index 0000000..a6875e1 --- /dev/null +++ b/app/models/pmdk_school_information.rb @@ -0,0 +1,3 @@ +class PmdkSchoolInformation < ApplicationRecord + belongs_to :user +end diff --git a/app/models/pmdk_total_score_information.rb b/app/models/pmdk_total_score_information.rb new file mode 100644 index 0000000..49ef6a4 --- /dev/null +++ b/app/models/pmdk_total_score_information.rb @@ -0,0 +1,3 @@ +class PmdkTotalScoreInformation < ApplicationRecord + belongs_to :user +end diff --git a/app/models/user.rb b/app/models/user.rb index da94299..5d201f2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -19,15 +19,18 @@ class User < ApplicationRecord # assign an activation token and digest to each user # before user created, using before_create callback before_create :create_activation_digest - has_one :personal - has_one :source - has_one :parent - has_one :major - has_many :addresses - has_many :languages - has_many :achievements - has_many :extras - has_many :organizations + has_one :personal, dependent: :destroy + has_one :source, dependent: :destroy + has_one :parent, dependent: :destroy + has_one :major, dependent: :destroy + has_many :addresses, dependent: :destroy + has_many :languages, dependent: :destroy + has_many :achievements, dependent: :destroy + has_many :extras, dependent: :destroy + has_many :organizations, dependent: :destroy + has_one :pmdk_each_score_information, dependent: :destroy + has_one :pmdk_total_score_information, dependent: :destroy + has_one :pmdk_school_information, dependent: :destroy #validates the user input validates(:name, presence: true) validates(:name, length: {maximum: 50}) diff --git a/app/views/pmdk_each_score_informations/create.html.erb b/app/views/pmdk_each_score_informations/create.html.erb new file mode 100644 index 0000000..3ef95d1 --- /dev/null +++ b/app/views/pmdk_each_score_informations/create.html.erb @@ -0,0 +1,2 @@ +
Find me in app/views/pmdk_each_score_informations/create.html.erb
diff --git a/app/views/pmdk_each_score_informations/edit.html.erb b/app/views/pmdk_each_score_informations/edit.html.erb new file mode 100644 index 0000000..bb5a774 --- /dev/null +++ b/app/views/pmdk_each_score_informations/edit.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/pmdk_each_score_informations/edit.html.erb
diff --git a/app/views/pmdk_each_score_informations/new.html.erb b/app/views/pmdk_each_score_informations/new.html.erb new file mode 100644 index 0000000..9a73dec --- /dev/null +++ b/app/views/pmdk_each_score_informations/new.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/pmdk_each_score_informations/new.html.erb
diff --git a/app/views/pmdk_each_score_informations/show.html.erb b/app/views/pmdk_each_score_informations/show.html.erb new file mode 100644 index 0000000..9d93e86 --- /dev/null +++ b/app/views/pmdk_each_score_informations/show.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/pmdk_each_score_informations/show.html.erb
diff --git a/app/views/pmdk_each_score_informations/update.html.erb b/app/views/pmdk_each_score_informations/update.html.erb new file mode 100644 index 0000000..2d6c7d9 --- /dev/null +++ b/app/views/pmdk_each_score_informations/update.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/pmdk_each_score_informations/update.html.erb
diff --git a/app/views/pmdk_school_informations/create.html.erb b/app/views/pmdk_school_informations/create.html.erb new file mode 100644 index 0000000..989c94c --- /dev/null +++ b/app/views/pmdk_school_informations/create.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/pmdk_school_informations/create.html.erb
diff --git a/app/views/pmdk_school_informations/edit.html.erb b/app/views/pmdk_school_informations/edit.html.erb new file mode 100644 index 0000000..d7822d5 --- /dev/null +++ b/app/views/pmdk_school_informations/edit.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/pmdk_school_informations/edit.html.erb
diff --git a/app/views/pmdk_school_informations/new.html.erb b/app/views/pmdk_school_informations/new.html.erb new file mode 100644 index 0000000..0877cf3 --- /dev/null +++ b/app/views/pmdk_school_informations/new.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/pmdk_school_informations/new.html.erb
diff --git a/app/views/pmdk_school_informations/show.html.erb b/app/views/pmdk_school_informations/show.html.erb new file mode 100644 index 0000000..50433d3 --- /dev/null +++ b/app/views/pmdk_school_informations/show.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/pmdk_school_informations/show.html.erb
diff --git a/app/views/pmdk_school_informations/update.html.erb b/app/views/pmdk_school_informations/update.html.erb new file mode 100644 index 0000000..5dec089 --- /dev/null +++ b/app/views/pmdk_school_informations/update.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/pmdk_school_informations/update.html.erb
diff --git a/app/views/pmdk_total_score_informations/create.html.erb b/app/views/pmdk_total_score_informations/create.html.erb new file mode 100644 index 0000000..4b62d1e --- /dev/null +++ b/app/views/pmdk_total_score_informations/create.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/pmdk_total_score_informations/create.html.erb
diff --git a/app/views/pmdk_total_score_informations/edit.html.erb b/app/views/pmdk_total_score_informations/edit.html.erb new file mode 100644 index 0000000..a74cb97 --- /dev/null +++ b/app/views/pmdk_total_score_informations/edit.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/pmdk_total_score_informations/edit.html.erb
diff --git a/app/views/pmdk_total_score_informations/new.html.erb b/app/views/pmdk_total_score_informations/new.html.erb new file mode 100644 index 0000000..fbc0ab4 --- /dev/null +++ b/app/views/pmdk_total_score_informations/new.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/pmdk_total_score_informations/new.html.erb
diff --git a/app/views/pmdk_total_score_informations/show.html.erb b/app/views/pmdk_total_score_informations/show.html.erb new file mode 100644 index 0000000..9e25e24 --- /dev/null +++ b/app/views/pmdk_total_score_informations/show.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/pmdk_total_score_informations/show.html.erb
diff --git a/app/views/pmdk_total_score_informations/update.html.erb b/app/views/pmdk_total_score_informations/update.html.erb new file mode 100644 index 0000000..9609b51 --- /dev/null +++ b/app/views/pmdk_total_score_informations/update.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/pmdk_total_score_informations/update.html.erb
diff --git a/config/routes.rb b/config/routes.rb index e0ebd00..e227d0e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -20,6 +20,7 @@ resources :parent_job_lists resources :high_school_majors resources :major_lists + # get 'personals/new' # get 'personals/update' # get 'personals/edit' @@ -73,7 +74,10 @@ resources :extras, only: [:new, :create, :edit, :update, :show] resources :organizations, only: [:new, :create, :edit, :update, :show] resources :sources, only: [:new, :create, :edit, :update, :show] - resources :majors, only: [:new, :create, :edit, :update, :show] + resources :majors, only: [:new, :create, :edit, :update, :show] + resources :pmdk_school_informations, only: [:new, :create, :edit, :update, :show] + resources :pmdk_each_score_informations, only: [:new, :create, :edit, :update, :show] + resources :pmdk_total_score_informations, only: [:new, :create, :edit, :update, :show] end diff --git a/db/migrate/20240125022622_create_pmdk_school_informations.rb b/db/migrate/20240125022622_create_pmdk_school_informations.rb new file mode 100644 index 0000000..919b342 --- /dev/null +++ b/db/migrate/20240125022622_create_pmdk_school_informations.rb @@ -0,0 +1,12 @@ +class CreatePmdkSchoolInformations < ActiveRecord::Migration[7.1] + def change + create_table :pmdk_school_informations do |t| + t.string :asal_sekolah + t.string :akreditas + t.numeric :jumlah_pelajaran_un + t.numeric :jumlah_nilai_un + + t.timestamps + end + end +end diff --git a/db/migrate/20240125023412_add_user_ref_to_pmdk_school_information.rb b/db/migrate/20240125023412_add_user_ref_to_pmdk_school_information.rb new file mode 100644 index 0000000..b85eeea --- /dev/null +++ b/db/migrate/20240125023412_add_user_ref_to_pmdk_school_information.rb @@ -0,0 +1,5 @@ +class AddUserRefToPmdkSchoolInformation < ActiveRecord::Migration[7.1] + def change + add_reference :pmdk_school_informations, :user, null: false, foreign_key: true + end +end diff --git a/db/migrate/20240125024340_create_pmdk_total_score_informations.rb b/db/migrate/20240125024340_create_pmdk_total_score_informations.rb new file mode 100644 index 0000000..746d618 --- /dev/null +++ b/db/migrate/20240125024340_create_pmdk_total_score_informations.rb @@ -0,0 +1,18 @@ +class CreatePmdkTotalScoreInformations < ActiveRecord::Migration[7.1] + def change + create_table :pmdk_total_score_informations do |t| + t.numeric :jumlah_nilai_semester_1 + t.numeric :jumlah_nilai_semester_2 + t.numeric :jumlah_nilai_semester_3 + t.numeric :jumlah_nilai_semester_4 + t.numeric :jumlah_nilai_semester_5 + t.numeric :jumlah_pelajaran_semester_1 + t.numeric :jumlah_pelajaran_semester_2 + t.numeric :jumlah_pelajaran_semester_3 + t.numeric :jumlah_pelajaran_semester_4 + t.numeric :jumlah_pelajaran_semester_5 + + t.timestamps + end + end +end diff --git a/db/migrate/20240125024622_add_user_ref_to_pmdk_total_score_information.rb b/db/migrate/20240125024622_add_user_ref_to_pmdk_total_score_information.rb new file mode 100644 index 0000000..8199913 --- /dev/null +++ b/db/migrate/20240125024622_add_user_ref_to_pmdk_total_score_information.rb @@ -0,0 +1,5 @@ +class AddUserRefToPmdkTotalScoreInformation < ActiveRecord::Migration[7.1] + def change + add_reference :pmdk_total_score_informations, :user, null: false, foreign_key: true + end +end diff --git a/db/migrate/20240125025003_create_pmdk_each_score_informations.rb b/db/migrate/20240125025003_create_pmdk_each_score_informations.rb new file mode 100644 index 0000000..dd58485 --- /dev/null +++ b/db/migrate/20240125025003_create_pmdk_each_score_informations.rb @@ -0,0 +1,31 @@ +class CreatePmdkEachScoreInformations < ActiveRecord::Migration[7.1] + def change + create_table :pmdk_each_score_informations do |t| + t.numeric :matematika_semester_1 + t.numeric :matematika_semester_2 + t.numeric :matematika_semester_3 + t.numeric :matematika_semester_4 + t.numeric :matematika_semester_5 + + t.numeric :fisika_semester_1 + t.numeric :fisika_semester_2 + t.numeric :fisika_semester_3 + t.numeric :fisika_semester_4 + t.numeric :fisika_semester_5 + + t.numeric :kimia_semester_1 + t.numeric :kimia_semester_2 + t.numeric :kimia_semester_3 + t.numeric :kimia_semester_4 + t.numeric :kimia_semester_5 + + t.numeric :bahasa_inggris_semester_1 + t.numeric :bahasa_inggris_semester_2 + t.numeric :bahasa_inggris_semester_3 + t.numeric :bahasa_inggris_semester_4 + t.numeric :bahasa_inggris_semester_5 + + t.timestamps + end + end +end diff --git a/db/migrate/20240125025449_add_user_ref_to_pmdk_each_score_information.rb b/db/migrate/20240125025449_add_user_ref_to_pmdk_each_score_information.rb new file mode 100644 index 0000000..6933058 --- /dev/null +++ b/db/migrate/20240125025449_add_user_ref_to_pmdk_each_score_information.rb @@ -0,0 +1,5 @@ +class AddUserRefToPmdkEachScoreInformation < ActiveRecord::Migration[7.1] + def change + add_reference :pmdk_each_score_informations, :user, null: false, foreign_key: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 212759c..d7ce02b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_01_24_102935) do +ActiveRecord::Schema[7.1].define(version: 2024_01_25_025449) do create_table "accreditation_school_lists", force: :cascade do |t| t.string "akreditasi" t.datetime "created_at", null: false @@ -285,12 +285,67 @@ t.index ["user_id"], name: "index_personals_on_user_id" end + create_table "pmdk_each_score_informations", force: :cascade do |t| + t.decimal "matematika_semester_1" + t.decimal "matematika_semester_2" + t.decimal "matematika_semester_3" + t.decimal "matematika_semester_4" + t.decimal "matematika_semester_5" + t.decimal "fisika_semester_1" + t.decimal "fisika_semester_2" + t.decimal "fisika_semester_3" + t.decimal "fisika_semester_4" + t.decimal "fisika_semester_5" + t.decimal "kimia_semester_1" + t.decimal "kimia_semester_2" + t.decimal "kimia_semester_3" + t.decimal "kimia_semester_4" + t.decimal "kimia_semester_5" + t.decimal "bahasa_inggris_semester_1" + t.decimal "bahasa_inggris_semester_2" + t.decimal "bahasa_inggris_semester_3" + t.decimal "bahasa_inggris_semester_4" + t.decimal "bahasa_inggris_semester_5" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "user_id", null: false + t.index ["user_id"], name: "index_pmdk_each_score_informations_on_user_id" + end + + create_table "pmdk_school_informations", force: :cascade do |t| + t.string "asal_sekolah" + t.string "akreditas" + t.decimal "jumlah_pelajaran_un" + t.decimal "jumlah_nilai_un" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "user_id", null: false + t.index ["user_id"], name: "index_pmdk_school_informations_on_user_id" + end + create_table "pmdk_school_lists", force: :cascade do |t| t.string "sekolah" t.datetime "created_at", null: false t.datetime "updated_at", null: false end + create_table "pmdk_total_score_informations", force: :cascade do |t| + t.decimal "jumlah_nilai_semester_1" + t.decimal "jumlah_nilai_semester_2" + t.decimal "jumlah_nilai_semester_3" + t.decimal "jumlah_nilai_semester_4" + t.decimal "jumlah_nilai_semester_5" + t.decimal "jumlah_pelajaran_semester_1" + t.decimal "jumlah_pelajaran_semester_2" + t.decimal "jumlah_pelajaran_semester_3" + t.decimal "jumlah_pelajaran_semester_4" + t.decimal "jumlah_pelajaran_semester_5" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "user_id", null: false + t.index ["user_id"], name: "index_pmdk_total_score_informations_on_user_id" + end + create_table "relationships", force: :cascade do |t| t.integer "follower_id" t.integer "followed_id" @@ -353,5 +408,8 @@ add_foreign_key "organizations", "users" add_foreign_key "parents", "users" add_foreign_key "personals", "users" + add_foreign_key "pmdk_each_score_informations", "users" + add_foreign_key "pmdk_school_informations", "users" + add_foreign_key "pmdk_total_score_informations", "users" add_foreign_key "sources", "users" end diff --git a/test/controllers/pmdk_each_score_informations_controller_test.rb b/test/controllers/pmdk_each_score_informations_controller_test.rb new file mode 100644 index 0000000..961b1ba --- /dev/null +++ b/test/controllers/pmdk_each_score_informations_controller_test.rb @@ -0,0 +1,28 @@ +require "test_helper" + +class PmdkEachScoreInformationsControllerTest < ActionDispatch::IntegrationTest + test "should get new" do + get pmdk_each_score_informations_new_url + assert_response :success + end + + test "should get update" do + get pmdk_each_score_informations_update_url + assert_response :success + end + + test "should get create" do + get pmdk_each_score_informations_create_url + assert_response :success + end + + test "should get edit" do + get pmdk_each_score_informations_edit_url + assert_response :success + end + + test "should get show" do + get pmdk_each_score_informations_show_url + assert_response :success + end +end diff --git a/test/controllers/pmdk_school_informations_controller_test.rb b/test/controllers/pmdk_school_informations_controller_test.rb new file mode 100644 index 0000000..b774e63 --- /dev/null +++ b/test/controllers/pmdk_school_informations_controller_test.rb @@ -0,0 +1,28 @@ +require "test_helper" + +class PmdkSchoolInformationsControllerTest < ActionDispatch::IntegrationTest + test "should get new" do + get pmdk_school_informations_new_url + assert_response :success + end + + test "should get update" do + get pmdk_school_informations_update_url + assert_response :success + end + + test "should get create" do + get pmdk_school_informations_create_url + assert_response :success + end + + test "should get edit" do + get pmdk_school_informations_edit_url + assert_response :success + end + + test "should get show" do + get pmdk_school_informations_show_url + assert_response :success + end +end diff --git a/test/controllers/pmdk_total_score_informations_controller_test.rb b/test/controllers/pmdk_total_score_informations_controller_test.rb new file mode 100644 index 0000000..6fbcbdb --- /dev/null +++ b/test/controllers/pmdk_total_score_informations_controller_test.rb @@ -0,0 +1,28 @@ +require "test_helper" + +class PmdkTotalScoreInformationsControllerTest < ActionDispatch::IntegrationTest + test "should get new" do + get pmdk_total_score_informations_new_url + assert_response :success + end + + test "should get update" do + get pmdk_total_score_informations_update_url + assert_response :success + end + + test "should get create" do + get pmdk_total_score_informations_create_url + assert_response :success + end + + test "should get edit" do + get pmdk_total_score_informations_edit_url + assert_response :success + end + + test "should get show" do + get pmdk_total_score_informations_show_url + assert_response :success + end +end diff --git a/test/fixtures/pmdk_each_score_informations.yml b/test/fixtures/pmdk_each_score_informations.yml new file mode 100644 index 0000000..cb5fd44 --- /dev/null +++ b/test/fixtures/pmdk_each_score_informations.yml @@ -0,0 +1,7 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + matematika_semester_1: MyString + +two: + matematika_semester_1: MyString diff --git a/test/fixtures/pmdk_school_informations.yml b/test/fixtures/pmdk_school_informations.yml new file mode 100644 index 0000000..dd8e46c --- /dev/null +++ b/test/fixtures/pmdk_school_informations.yml @@ -0,0 +1,13 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + asal_sekolah: MyString + akreditas: MyString + jumlah_pelajaran_un: MyString + jumlah_nilai_un: MyString + +two: + asal_sekolah: MyString + akreditas: MyString + jumlah_pelajaran_un: MyString + jumlah_nilai_un: MyString diff --git a/test/fixtures/pmdk_total_score_informations.yml b/test/fixtures/pmdk_total_score_informations.yml new file mode 100644 index 0000000..23009e1 --- /dev/null +++ b/test/fixtures/pmdk_total_score_informations.yml @@ -0,0 +1,7 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + jumlah_nilai_semester_1: MyString + +two: + jumlah_nilai_semester_1: MyString diff --git a/test/models/pmdk_each_score_information_test.rb b/test/models/pmdk_each_score_information_test.rb new file mode 100644 index 0000000..11b9e84 --- /dev/null +++ b/test/models/pmdk_each_score_information_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class PmdkEachScoreInformationTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/pmdk_school_information_test.rb b/test/models/pmdk_school_information_test.rb new file mode 100644 index 0000000..c7d71ac --- /dev/null +++ b/test/models/pmdk_school_information_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class PmdkSchoolInformationTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/pmdk_total_score_information_test.rb b/test/models/pmdk_total_score_information_test.rb new file mode 100644 index 0000000..da5c766 --- /dev/null +++ b/test/models/pmdk_total_score_information_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class PmdkTotalScoreInformationTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end