Skip to content

Commit

Permalink
Merge pull request #1712 from DFE-Digital/dependabot/bundler/syntax_t…
Browse files Browse the repository at this point in the history
…ree-6.2.0

Bump syntax_tree from 6.1.1 to 6.2.0
  • Loading branch information
thomasleese authored Sep 24, 2023
2 parents 0bfdfab + cec2b97 commit 0e86a00
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 30 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ RUN apk add --update --no-cache tzdata && \
cp /usr/share/zoneinfo/Europe/London /etc/localtime && \
echo "Europe/London" > /etc/timezone

# Upgrade ssl and crypto libraries to latest version
RUN apk upgrade --no-cache openssl libssl3 libcrypto3
# Upgrade ssl, crypto and curl libraries to latest version
RUN apk upgrade --no-cache openssl libssl3 libcrypto3 curl

# build-base: dependencies for bundle
# yarn: node package manager
Expand Down Expand Up @@ -77,8 +77,8 @@ RUN apk add --update --no-cache tzdata && \
cp /usr/share/zoneinfo/Europe/London /etc/localtime && \
echo "Europe/London" > /etc/timezone

# Upgrade ssl and crypto libraries to latest version
RUN apk upgrade --no-cache openssl libssl3 libcrypto3
# Upgrade ssl, crypto and curl libraries to latest version
RUN apk upgrade --no-cache openssl libssl3 libcrypto3 curl

# libpq: required to run postgres
# vips-dev: dependencies for ruby-vips (image processing library)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ GEM
snaky_hash (2.0.1)
hashie
version_gem (~> 1.1, >= 1.1.1)
syntax_tree (6.1.1)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
syntax_tree-haml (4.0.3)
haml (>= 5.2)
Expand Down
4 changes: 2 additions & 2 deletions app/forms/assessor_interface/assessment_section_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class AssessorInterface::AssessmentSectionForm
if: -> { passed == false }
validates :work_history,
presence: true,
if: -> {
if: -> do
passed == false &&
FailureReasons.chooses_work_history?(
failure_reason: selected_failure_reasons,
)
}
end

def selected_failure_reasons
return {} if passed
Expand Down
4 changes: 2 additions & 2 deletions app/forms/assessor_interface/select_qualifications_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ class AssessorInterface::SelectQualificationsForm
validates :qualification_ids,
presence: true,
inclusion: {
in: ->(form) {
in: ->(form) do
form
.application_form
&.qualifications
&.pluck(:id)
&.map(&:to_s) || []
},
end,
}

def save
Expand Down
4 changes: 2 additions & 2 deletions app/forms/assessor_interface/select_work_histories_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ class AssessorInterface::SelectWorkHistoriesForm
attribute :work_history_ids
validates :work_history_ids,
inclusion: {
in: ->(form) {
in: ->(form) do
form
.application_form
&.work_histories
&.pluck(:id)
&.map(&:to_s) || []
},
end,
}
validate :work_history_enough_months

Expand Down
4 changes: 2 additions & 2 deletions app/forms/teacher_interface/qualification_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class QualificationForm < BaseForm
validates :institution_country_location,
presence: true,
inclusion: {
in: ->(form) {
in: ->(form) do
[CountryCode.to_location(form.application_form.country.code)]
},
end,
},
if: -> { qualification&.is_teaching_qualification? }
validates :start_date, date: true
Expand Down
12 changes: 6 additions & 6 deletions app/models/application_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class ApplicationForm < ApplicationRecord
STATUS_COLUMNS.each { |column| enum column, STATUS_VALUES, prefix: column }

scope :assessable,
-> {
-> do
where(
status: %i[
preliminary_check
Expand All @@ -171,26 +171,26 @@ class ApplicationForm < ApplicationRecord
overdue
],
)
}
end

scope :active,
-> {
-> do
assessable
.or(awarded_pending_checks)
.or(potential_duplicate_in_dqt)
.or(awarded.where("awarded_at >= ?", 90.days.ago))
.or(declined.where("declined_at >= ?", 90.days.ago))
.or(withdrawn.where("withdrawn_at >= ?", 90.days.ago))
}
end

scope :destroyable,
-> {
-> do
draft
.where("created_at < ?", 6.months.ago)
.or(awarded.where("awarded_at < ?", 5.years.ago))
.or(declined.where("declined_at < ?", 5.years.ago))
.or(withdrawn.where("withdrawn_at < ?", 5.years.ago))
}
end

scope :remindable, -> { draft.where("created_at < ?", 5.months.ago) }

Expand Down
12 changes: 6 additions & 6 deletions app/models/eligibility_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,31 @@ class EligibilityCheck < ApplicationRecord

scope :complete, -> { where.not(completed_at: nil) }
scope :eligible,
-> {
-> do
where.not(region: nil).where(
degree: true,
free_of_sanctions: true,
qualification: true,
teach_children: true,
)
}
end
scope :ineligible,
-> {
-> do
where(degree: false)
.or(where(free_of_sanctions: false))
.or(where(qualification: false))
.or(where(region: nil))
.or(where(teach_children: false))
}
end
scope :answered_all_questions,
-> {
-> do
where.not(
degree: nil,
free_of_sanctions: nil,
qualification: nil,
teach_children: nil,
)
}
end

delegate :country, to: :region, allow_nil: true

Expand Down
4 changes: 2 additions & 2 deletions app/models/further_information_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ class FurtherInformationRequest < ApplicationRecord
dependent: :destroy

scope :remindable,
-> {
-> do
requested.joins(assessment: :application_form).merge(
ApplicationForm.assessable,
)
}
end

FOUR_WEEK_COUNTRY_CODES = %w[AU CA GI NZ US].freeze

Expand Down
4 changes: 2 additions & 2 deletions app/models/reference_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ class ReferenceRequest < ApplicationRecord
belongs_to :work_history

scope :remindable,
-> {
-> do
requested.joins(assessment: :application_form).merge(
ApplicationForm.assessable,
)
}
end

with_options if: :received? do
validates :contact_response, inclusion: [true, false]
Expand Down
2 changes: 1 addition & 1 deletion spec/services/send_reminder_email_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
end

context "with less than two weeks remaining" do
let(:application_created_at) { (6.months - 8.days).ago }
let(:application_created_at) { (6.months - 13.days).ago }
include_examples "first reminder email",
"sends an application not submitted email"
end
Expand Down

0 comments on commit 0e86a00

Please sign in to comment.