Skip to content

Commit ba6ec99

Browse files
Merge pull request #5691 from nhsuk/revert-upload-only-team-year-groups
Revert "Set Team.year_groups statically for upload-only teams"
2 parents f4f36f1 + 3718c27 commit ba6ec99

2 files changed

Lines changed: 0 additions & 18 deletions

File tree

app/models/team.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ class ActiveRecord_Relation < ActiveRecord::Relation
4545
include ContributesToPatientTeams::Relation
4646
end
4747

48-
UPLOAD_ONLY_YEAR_GROUPS = (-2..13).to_a.freeze
49-
5048
audited associated_with: :organisation
5149
has_associated_audits
5250

@@ -97,8 +95,6 @@ class ActiveRecord_Relation < ActiveRecord::Relation
9795
def to_param = workgroup
9896

9997
def year_groups(academic_year: nil)
100-
return UPLOAD_ONLY_YEAR_GROUPS if has_upload_only_access?
101-
10298
academic_year ||= AcademicYear.pending
10399
location_programme_year_groups
104100
.joins(:location_year_group)

spec/models/team_spec.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,4 @@
6464

6565
it_behaves_like "a model with a normalised email address"
6666
it_behaves_like "a model with a normalised phone number"
67-
68-
describe "#year_groups" do
69-
context "when team has upload_only access" do
70-
let(:team) { create(:team, type: :upload_only) }
71-
72-
it "covers nursery to upper sixth" do
73-
expect(team.year_groups).to eq((-2..13).to_a)
74-
end
75-
76-
it "ignores academic_year parameter" do
77-
expect(team.year_groups(academic_year: 2024)).to eq((-2..13).to_a)
78-
end
79-
end
80-
end
8167
end

0 commit comments

Comments
 (0)