swap around schools and district to not be namespaced

This commit is contained in:
Nelson Jovel 2024-01-04 21:25:39 -08:00
parent 865b7b17af
commit 7f69cda710
15 changed files with 67 additions and 57 deletions

View file

@ -1,6 +1,6 @@
module Dashboard
class AdminDataValue < ApplicationRecord
belongs_to :dashboard_school
belongs_to :school
belongs_to :dashboard_admin_data_item
belongs_to :dashboard_academic_year

View file

@ -1,7 +1,8 @@
module Dashboard
class District < ApplicationRecord
self.table_name = "districts"
has_many :schools, class_name: "Dashboard::School"
has_many :schools, class_name: "Dashboard::School"
has_many :dashboard_schools, class_name: "Dashboard::School"
validates :name, presence: true

View file

@ -1,6 +1,6 @@
module Dashboard
class Respondent < ApplicationRecord
belongs_to :dashboard_school
belongs_to :school
belongs_to :dashboard_academic_year
validates :school, uniqueness: { scope: :academic_year }

View file

@ -1,7 +1,7 @@
module Dashboard
class ResponseRate < ApplicationRecord
belongs_to :dashboard_subcategory
belongs_to :dashboard_school
belongs_to :school
belongs_to :dashboard_academic_year
end
end

View file

@ -1,6 +1,7 @@
module Dashboard
class School < ApplicationRecord
belongs_to :dashboard_district, class_name: "Dashboard::District"
self.table_name = "schools"
belongs_to :district, class_name: "District", primary_key: :id
has_many :dashboard_survey_item_responses, dependent: :delete_all

View file

@ -1,7 +1,7 @@
module Dashboard
class Score < ApplicationRecord
belongs_to :dashboard_measure
belongs_to :dashboard_school
belongs_to :school
belongs_to :dashboard_academic_year
belongs_to :dashboard_race

View file

@ -3,7 +3,7 @@ module Dashboard
TEACHER_RESPONSE_THRESHOLD = 2
STUDENT_RESPONSE_THRESHOLD = 10
belongs_to :dashboard_school
belongs_to :school
belongs_to :dashboard_survey_item
belongs_to :dashboard_academic_year
belongs_to :dashboard_student, optional: true