mirror of
https://github.com/edcommonwealth/Dashboard.git
synced 2026-03-07 21:38:14 -08:00
swap around schools and district to not be namespaced
This commit is contained in:
parent
865b7b17af
commit
7f69cda710
15 changed files with 67 additions and 57 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue