Skip to content

Commit 8ee4570

Browse files
committed
trusts_code for Single acedamty trust
1 parent fb045f6 commit 8ee4570

14 files changed

Lines changed: 23 additions & 62 deletions

app/controllers/omniauth_callbacks_controller.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,8 @@ def organisation_from_request
108108
# contained within the trust and use that instead
109109
uid = auth_hash.dig("extra", "raw_info", "organisation", "uid")
110110
contained_school = School.find_by(
111-
"gias_data->>'TrustSchoolFlag (code)' = ? AND gias_data->>'Trusts (code)' = ?",
112-
"5", # "Supported by a single-academy trust"
113-
uid,
111+
trust_school_flag_code: 5, # "Supported by a single-academy trust"
112+
trusts_code: uid,
114113
)
115114

116115
contained_school || raise("Could not find a school contained in SAT (UID #{uid})")

app/jobs/refresh_organisations_gias_data_hash_job.rb

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/models/organisation.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,6 @@ def trust_or_la?
138138
trust? || local_authority?
139139
end
140140

141-
# def refresh_gias_data_hash
142-
# computed_hash = gias_data.presence && Digest::SHA256.hexdigest(gias_data.to_s)
143-
# return if gias_data_hash == computed_hash
144-
#
145-
# update(gias_data_hash: computed_hash)
146-
# end
147-
148141
def has_ofsted_report?
149142
urn.present?
150143
end

app/models/school.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,6 @@ class School < Organisation
106106
through: %i[early_years ks1 ks2 ks3 ks4 ks5],
107107
}.freeze
108108

109-
# def religious_character
110-
# return if !respond_to?(:gias_data) || gias_data.nil?
111-
# return if ["None", "Does not apply"].include?(gias_data["ReligiousCharacter (name)"])
112-
#
113-
# gias_data["ReligiousCharacter (name)"]
114-
# end
115-
116109
def live_group_vacancies
117110
if part_of_a_trust?
118111
org_ids = [trust.id] + trust.schools.pluck(:id)

app/services/gias/import_schools_and_local_authorities.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ def group_data(row)
9595
local_authority_code: row["LA (code)"],
9696
name: row["LA (name)"],
9797
group_type: "local_authority",
98-
# gias_data: row.to_h.slice("LA (code)", "LA (name)"),
9998
}
10099
end
101100

@@ -121,6 +120,8 @@ def school_data(row) # rubocop:disable Metrics/MethodLength
121120
religious_character: row.fetch("ReligiousCharacter (name)").presence || "None",
122121
number_of_pupils: row.fetch("NumberOfPupils"),
123122
school_capacity: row.fetch("SchoolCapacity"),
123+
trust_school_flag_code: row.fetch("TrustSchoolFlag (code)"),
124+
trusts_code: row.fetch("Trusts (code)"),
124125
}.merge(school_location_data(row)).transform_values(&:presence)
125126
end
126127

app/services/gias/import_trusts.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ def trust_data(row)
130130
group_type: row["Group Type"],
131131
town: row["Group Town"],
132132
postcode: row["Group Postcode"],
133-
# gias_data: row.to_h,
134133
}
135134
end
136135

config/analytics_blocklist.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@
162162
:organisations:
163163
- religious_character
164164
- number_of_pupils
165+
- trust_school_flag_code
166+
- trusts_code
165167
- school_capacity
166168
- slug
167169
- searchable_content

config/schedule.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,6 @@ import_organisation_data:
175175
class: 'ImportOrganisationDataJob'
176176
queue: low
177177

178-
refresh_organisations_gias_data_hash:
179-
cron: '0 23 * * *' # "At 23:00."
180-
class: 'RefreshOrganisationsGiasDataHashJob'
181-
queue: low
182-
183178
index_newly_published_vacancies:
184179
cron: '01 00 * * *' # "At 00:01."
185180
class: 'IndexNewlyPublishedVacanciesJob'

db/migrate/20260423141519_add_religious_character_to_school.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ def change
33
add_column :organisations, :religious_character, :string
44
add_column :organisations, :number_of_pupils, :integer
55
add_column :organisations, :school_capacity, :integer
6+
add_column :organisations, :trust_school_flag_code, :integer
7+
add_column :organisations, :trusts_code, :integer
68
end
79
end

db/schema.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,8 @@
576576
t.string "religious_character"
577577
t.integer "number_of_pupils"
578578
t.integer "school_capacity"
579+
t.integer "trust_school_flag_code"
580+
t.integer "trusts_code"
579581
t.index ["geopoint"], name: "index_organisations_on_geopoint", using: :gist
580582
t.index ["local_authority_code"], name: "index_organisations_on_local_authority_code", unique: true
581583
t.index ["searchable_content"], name: "index_organisations_on_searchable_content", using: :gin

0 commit comments

Comments
 (0)