dirty commit: can't get references to work correctly between any tables

This commit is contained in:
Nelson Jovel 2024-01-04 19:36:10 -08:00
parent e1f0b78236
commit a4fddbeced
183 changed files with 5461 additions and 5 deletions

View file

@ -10,10 +10,68 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2023_12_23_040511) do
ActiveRecord::Schema[7.1].define(version: 2024_01_04_192128) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "dashboard_academic_years", force: :cascade do |t|
t.string "range"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["range"], name: "index_dashboard_academic_years_on_range"
end
create_table "dashboard_admin_data_items", force: :cascade do |t|
t.string "admin_data_item_id"
t.string "description"
t.float "watch_low_benchmark"
t.float "growth_low_benchmark"
t.float "approval_low_benchmark"
t.float "ideal_low_benchmark"
t.boolean "hs_only_item"
t.bigint "dashboard_scale_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["dashboard_scale_id"], name: "index_dashboard_admin_data_items_on_dashboard_scale_id"
end
create_table "dashboard_admin_data_values", force: :cascade do |t|
t.float "likert_score"
t.bigint "dashboard_school_id", null: false
t.bigint "dashboard_admin_data_item_id", null: false
t.bigint "dashboard_academic_year_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["dashboard_academic_year_id"], name: "idx_on_dashboard_academic_year_id_1de27231d5"
t.index ["dashboard_admin_data_item_id"], name: "idx_on_dashboard_admin_data_item_id_edae2faad3"
t.index ["dashboard_school_id"], name: "index_dashboard_admin_data_values_on_dashboard_school_id"
end
create_table "dashboard_categories", force: :cascade do |t|
t.string "name"
t.text "description"
t.string "slug"
t.string "category_id"
t.string "short_description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "dashboard_districts", force: :cascade do |t|
t.string "name"
t.string "slug"
t.integer "qualtrics_code"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "dashboard_ells", force: :cascade do |t|
t.string "designation"
t.string "slug"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "dashboard_examples", force: :cascade do |t|
t.string "text"
t.text "body"
@ -21,4 +79,200 @@ ActiveRecord::Schema[7.1].define(version: 2023_12_23_040511) do
t.datetime "updated_at", null: false
end
create_table "dashboard_genders", force: :cascade do |t|
t.integer "qualtrics_code"
t.string "designation"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "dashboard_incomes", force: :cascade do |t|
t.string "designation"
t.string "slug"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "dashboard_measures", force: :cascade do |t|
t.string "measure_id"
t.string "name"
t.bigint "dashboard_subcategory_id", null: false
t.text "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["dashboard_subcategory_id"], name: "index_dashboard_measures_on_dashboard_subcategory_id"
end
create_table "dashboard_races", force: :cascade do |t|
t.string "designation"
t.integer "qualtrics_code"
t.string "slug"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "dashboard_respondents", force: :cascade do |t|
t.bigint "dashboard_school_id", null: false
t.bigint "dashboard_academic_year_id", null: false
t.integer "total_students"
t.float "total_teachers"
t.integer "pk"
t.integer "k"
t.integer "one"
t.integer "two"
t.integer "three"
t.integer "four"
t.integer "five"
t.integer "six"
t.integer "seven"
t.integer "eight"
t.integer "nine"
t.integer "ten"
t.integer "eleven"
t.integer "twelve"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["dashboard_academic_year_id"], name: "index_dashboard_respondents_on_dashboard_academic_year_id"
t.index ["dashboard_school_id"], name: "index_dashboard_respondents_on_dashboard_school_id"
end
create_table "dashboard_response_rates", force: :cascade do |t|
t.bigint "dashboard_subcategory_id", null: false
t.bigint "dashboard_school_id", null: false
t.bigint "dashboard_academic_year_id", null: false
t.float "school_response_rate"
t.float "teacher_response_rate"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["dashboard_academic_year_id"], name: "index_dashboard_response_rates_on_dashboard_academic_year_id"
t.index ["dashboard_school_id"], name: "index_dashboard_response_rates_on_dashboard_school_id"
t.index ["dashboard_subcategory_id"], name: "index_dashboard_response_rates_on_dashboard_subcategory_id"
end
create_table "dashboard_scales", force: :cascade do |t|
t.string "scale_id"
t.bigint "dashboard_measure_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["dashboard_measure_id"], name: "index_dashboard_scales_on_dashboard_measure_id"
end
create_table "dashboard_schools", force: :cascade do |t|
t.string "name"
t.bigint "dashboard_district_id", null: false
t.text "description"
t.string "slug"
t.integer "qualtrics_code"
t.integer "dese_id"
t.boolean "is_hs"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["dashboard_district_id"], name: "index_dashboard_schools_on_dashboard_district_id"
end
create_table "dashboard_scores", force: :cascade do |t|
t.float "average"
t.boolean "meets_teacher_threshold"
t.boolean "meets_student_threshold"
t.boolean "meets_admin_data_threshold"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "dashboard_speds", force: :cascade do |t|
t.string "designation"
t.string "slug"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "dashboard_student_races", force: :cascade do |t|
t.bigint "dashboard_student_id", null: false
t.bigint "dashboard_race_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["dashboard_race_id"], name: "index_dashboard_student_races_on_dashboard_race_id"
t.index ["dashboard_student_id"], name: "index_dashboard_student_races_on_dashboard_student_id"
end
create_table "dashboard_students", force: :cascade do |t|
t.string "lasid"
t.string "response_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "dashboard_subcategories", force: :cascade do |t|
t.string "name"
t.text "description"
t.string "subcategory_id"
t.bigint "dashboard_categories_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["dashboard_categories_id"], name: "index_dashboard_subcategories_on_dashboard_categories_id"
end
create_table "dashboard_survey_item_responses", force: :cascade do |t|
t.integer "likert_score"
t.bigint "dashboard_school_id", null: false
t.bigint "dashboard_survey_item_id", null: false
t.bigint "dashboard_academic_year_id", null: false
t.bigint "dashboard_student_id", null: false
t.bigint "dashboard_gender_id", null: false
t.bigint "dashboard_income_id", null: false
t.bigint "dashboard_ell_id", null: false
t.bigint "dashboard_sped_id", null: false
t.string "response_id"
t.integer "grade"
t.datetime "recorded_date"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["dashboard_academic_year_id"], name: "idx_on_dashboard_academic_year_id_98a9cc7783"
t.index ["dashboard_ell_id"], name: "index_dashboard_survey_item_responses_on_dashboard_ell_id"
t.index ["dashboard_gender_id"], name: "index_dashboard_survey_item_responses_on_dashboard_gender_id"
t.index ["dashboard_income_id"], name: "index_dashboard_survey_item_responses_on_dashboard_income_id"
t.index ["dashboard_school_id"], name: "index_dashboard_survey_item_responses_on_dashboard_school_id"
t.index ["dashboard_sped_id"], name: "index_dashboard_survey_item_responses_on_dashboard_sped_id"
t.index ["dashboard_student_id"], name: "index_dashboard_survey_item_responses_on_dashboard_student_id"
t.index ["dashboard_survey_item_id"], name: "idx_on_dashboard_survey_item_id_3f6652fbc6"
end
create_table "dashboard_survey_items", force: :cascade do |t|
t.string "survey_item_id"
t.string "prompt"
t.float "watch_low_benchmark"
t.float "growth_low_benchmark"
t.float "approval_low_benchmark"
t.float "ideal_low_benchmark"
t.bigint "dashboard_scale_id", null: false
t.boolean "on_short_form"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["dashboard_scale_id"], name: "index_dashboard_survey_items_on_dashboard_scale_id"
end
add_foreign_key "dashboard_admin_data_items", "dashboard_scales"
add_foreign_key "dashboard_admin_data_values", "dashboard_academic_years"
add_foreign_key "dashboard_admin_data_values", "dashboard_admin_data_items"
add_foreign_key "dashboard_admin_data_values", "dashboard_schools"
add_foreign_key "dashboard_measures", "dashboard_subcategories"
add_foreign_key "dashboard_respondents", "dashboard_academic_years"
add_foreign_key "dashboard_respondents", "dashboard_schools"
add_foreign_key "dashboard_response_rates", "dashboard_academic_years"
add_foreign_key "dashboard_response_rates", "dashboard_schools"
add_foreign_key "dashboard_response_rates", "dashboard_subcategories"
add_foreign_key "dashboard_scales", "dashboard_measures"
add_foreign_key "dashboard_schools", "dashboard_districts"
add_foreign_key "dashboard_student_races", "dashboard_races"
add_foreign_key "dashboard_student_races", "dashboard_students"
add_foreign_key "dashboard_subcategories", "dashboard_categories", column: "dashboard_categories_id"
add_foreign_key "dashboard_survey_item_responses", "dashboard_academic_years"
add_foreign_key "dashboard_survey_item_responses", "dashboard_ells"
add_foreign_key "dashboard_survey_item_responses", "dashboard_genders"
add_foreign_key "dashboard_survey_item_responses", "dashboard_incomes"
add_foreign_key "dashboard_survey_item_responses", "dashboard_schools"
add_foreign_key "dashboard_survey_item_responses", "dashboard_speds"
add_foreign_key "dashboard_survey_item_responses", "dashboard_students"
add_foreign_key "dashboard_survey_item_responses", "dashboard_survey_items"
add_foreign_key "dashboard_survey_items", "dashboard_scales"
end

View file

@ -0,0 +1,5 @@
FactoryBot.define do
factory :academic_year do
range { "MyString" }
end
end

View file

@ -0,0 +1,12 @@
FactoryBot.define do
factory :admin_data_item do
admin_data_item_id { "MyString" }
description { "MyString" }
watch_low_benchmark { 1.5 }
growth_low_benchmark { 1.5 }
approval_low_benchmark { 1.5 }
ideal_low_benchmark { 1.5 }
hs_only_item { false }
dashboard_scale { nil }
end
end

View file

@ -0,0 +1,8 @@
FactoryBot.define do
factory :admin_data_value do
likert_score { 1.5 }
dashboard_school { nil }
dashboard_admin_data_item { nil }
dashboard_academic_year { nil }
end
end

View file

@ -0,0 +1,9 @@
FactoryBot.define do
factory :category do
name { "MyString" }
description { "MyText" }
slug { "MyString" }
category_id { "MyString" }
short_description { "MyString" }
end
end

View file

@ -0,0 +1,7 @@
FactoryBot.define do
factory :district do
name { "MyString" }
slug { "MyString" }
qualtrics_code { 1 }
end
end

View file

@ -0,0 +1,6 @@
FactoryBot.define do
factory :ell do
designation { "MyString" }
slug { "MyString" }
end
end

View file

@ -0,0 +1,6 @@
FactoryBot.define do
factory :gender do
qualtrics_code { 1 }
designation { "MyString" }
end
end

View file

@ -0,0 +1,6 @@
FactoryBot.define do
factory :income do
designation { "MyString" }
slug { "MyString" }
end
end

View file

@ -0,0 +1,8 @@
FactoryBot.define do
factory :measure do
measure_id { "MyString" }
name { "MyString" }
dashboard_subcategory { nil }
description { "MyText" }
end
end

View file

@ -0,0 +1,7 @@
FactoryBot.define do
factory :race do
designation { "MyString" }
qualtrics_code { 1 }
slug { "MyString" }
end
end

View file

@ -0,0 +1,22 @@
FactoryBot.define do
factory :respondent do
dashboard_school { nil }
dashboard_academic_year { nil }
total_students { 1 }
total_teachers { 1.5 }
pk { 1 }
k { 1 }
one { 1 }
two { 1 }
three { 1 }
four { 1 }
five { 1 }
six { 1 }
seven { 1 }
eight { 1 }
nine { 1 }
ten { 1 }
eleven { 1 }
twelve { 1 }
end
end

View file

@ -0,0 +1,9 @@
FactoryBot.define do
factory :response_rate do
subcategory { nil }
school { nil }
academic_year { nil }
school_response_rate { 1.5 }
teacher_response_rate { 1.5 }
end
end

View file

@ -0,0 +1,6 @@
FactoryBot.define do
factory :scale do
scale_id { "MyString" }
measure { nil }
end
end

View file

@ -0,0 +1,11 @@
FactoryBot.define do
factory :school do
name { "MyString" }
dashboard_district { nil }
description { "MyText" }
slug { "MyString" }
qualtrics_code { 1 }
dese_id { 1 }
is_hs { false }
end
end

View file

@ -0,0 +1,8 @@
FactoryBot.define do
factory :score do
average { 1.5 }
meets_teacher_threshold { false }
meets_student_threshold { false }
meets_admin_data_threshold { false }
end
end

View file

@ -0,0 +1,6 @@
FactoryBot.define do
factory :sped do
designation { "MyString" }
slug { "MyString" }
end
end

View file

@ -0,0 +1,6 @@
FactoryBot.define do
factory :student_race do
dashboard_student { nil }
dashboard_race { nil }
end
end

View file

@ -0,0 +1,6 @@
FactoryBot.define do
factory :student do
lasid { "MyString" }
response_id { "MyString" }
end
end

View file

@ -0,0 +1,8 @@
FactoryBot.define do
factory :subcategory do
name { "MyString" }
description { "MyText" }
subcategory_id { "MyString" }
dashboard_categories { nil }
end
end

View file

@ -0,0 +1,16 @@
FactoryBot.define do
factory :survey_item_response do
likert_score { 1 }
dashboard_school { nil }
dashboard_survey_item { nil }
dashboard_academic_year { nil }
dashboard_student { nil }
dashboard_gender { nil }
dashboard_income { nil }
dashboard_ell { nil }
dashboard_sped { nil }
response_id { "MyString" }
grade { 1 }
recorded_date { "2024-01-04 11:21:28" }
end
end

View file

@ -0,0 +1,12 @@
FactoryBot.define do
factory :survey_item do
survey_item_id { "MyString" }
prompt { "MyString" }
watch_low_benchmark { 1.5 }
growth_low_benchmark { 1.5 }
approval_low_benchmark { 1.5 }
ideal_low_benchmark { 1.5 }
dashboard_scale { nil }
on_short_form { false }
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe AcademicYear, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe AdminDataItem, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe AdminDataValue, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe Category, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe District, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe Ell, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe Gender, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe Income, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe Measure, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe Race, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe Respondent, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe ResponseRate, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe Scale, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe School, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe Score, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe Sped, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe StudentRace, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe Student, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe Subcategory, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe SurveyItemResponse, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -0,0 +1,7 @@
require 'rails_helper'
module Dashboard
RSpec.describe SurveyItem, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end

View file

@ -2,6 +2,7 @@ require "rails_helper"
require "nokogiri"
module Dashboard
include Engine.routes.url_helpers
RSpec.describe "/dashboard/examples/index", type: :view do
before(:each) do
assign(:examples, [

View file

@ -1,7 +1,8 @@
require "rails_helper"
module Dashboard
RSpec.xdescribe "dashboard/examples/new", type: :view do
include Engine.routes.url_helpers
RSpec.describe "dashboard/examples/new", type: :view do
before(:each) do
assign(:example, Example.new(
text: "MyString",