Skip to content

Commit

Permalink
Fix pipeline issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mandanakhademi committed Jan 8, 2024
1 parent aece63b commit f12f980
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gem "rails", "~> 7.0", ">= 7.0.5.1"
# Use postgresql as the database for Active Record
gem "pg", "~> 1.1"
# Use Puma as the app server
gem "puma", "~> 5.6"
gem "puma", "~> 6.0"
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem "webpacker", "~> 5.0"
# GOV UK frontend components
Expand Down
7 changes: 5 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ GEM
nio4r (2.7.0)
nokogiri (1.16.0-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.0-x86_64-linux)
racc (~> 1.4)
notifications-ruby-client (5.4.0)
jwt (>= 1.5, < 3)
pagy (6.2.0)
Expand All @@ -205,7 +207,7 @@ GEM
psych (5.1.2)
stringio
public_suffix (5.0.4)
puma (5.6.8)
puma (6.4.2)
nio4r (~> 2.0)
racc (1.7.3)
rack (3.0.8)
Expand Down Expand Up @@ -393,6 +395,7 @@ GEM

PLATFORMS
arm64-darwin-22
x86_64-linux

DEPENDENCIES
aws-sdk-s3
Expand All @@ -409,7 +412,7 @@ DEPENDENCIES
listen (~> 3.3)
pg (~> 1.1)
pry-byebug
puma (~> 5.6)
puma (~> 6.0)
rack-attack
rack_session_access
rails (~> 7.0, >= 7.0.5.1)
Expand Down
24 changes: 12 additions & 12 deletions app/controllers/concerns/eoi_workflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@ class EoiWorkflow
pc = UKPostcode.parse(eoi_instance.residential_postcode)
case pc.country
when :england
return :skip_diff_addr
:skip_diff_addr
when :northern_ireland
return :skip_diff_addr
:skip_diff_addr
when :scotland
return :redirect_scotland
:redirect_scotland
when :wales
return :redirect_wales
:redirect_wales
else
return :skip_diff_addr
:skip_diff_addr
end
else
return :back_to_address
:back_to_address
end
end
end,
Expand All @@ -102,18 +102,18 @@ class EoiWorkflow
pc = UKPostcode.parse(params["property_one_postcode"])
case pc.country
when :england
return :go_next
:go_next
when :northern_ireland
return :go_next
:go_next
when :scotland
return :redirect_scotland
:redirect_scotland
when :wales
return :redirect_wales
:redirect_wales
else
return :go_next
:go_next
end
else
return :reload
:reload
end
end,
"7" => lambda do |params, _eoi_instance|
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/uam_workflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def self.state_has_tag(state, tag)
end

def self.find_by_tag(tag)
@states.each do |state_name, _state_def|
@states.each_key do |state_name|
if state_has_tag(state_name, tag)
return state_name
end
Expand Down
6 changes: 3 additions & 3 deletions app/models/concerns/expression_of_interest_validations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ def validate_agree_privacy_statement

def validate_hosting_start_date
if @host_as_soon_as_possible == "false" && @hosting_start_date.present?
start_day = (@hosting_start_date["3"] || @hosting_start_date[3] || nil)
start_month = (@hosting_start_date["2"] || @hosting_start_date[2] || nil)
start_year = (@hosting_start_date["1"] || @hosting_start_date[1] || nil)
start_day = @hosting_start_date["3"] || @hosting_start_date[3] || nil
start_month = @hosting_start_date["2"] || @hosting_start_date[2] || nil
start_year = @hosting_start_date["1"] || @hosting_start_date[1] || nil
if !start_year.to_i || !start_month.to_i || !start_day.to_i
errors.add(:hosting_start_date, I18n.t(:invalid_hosting_start_date, scope: :error))
end
Expand Down
18 changes: 9 additions & 9 deletions app/models/concerns/uam_validations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ def nationality_permitted_value(nationality)

def validate_sponsor_date_of_birth
if @sponsor_date_of_birth.present?
dob_day = (@sponsor_date_of_birth["3"] || @sponsor_date_of_birth[3] || nil)
dob_month = (@sponsor_date_of_birth["2"] || @sponsor_date_of_birth[2] || nil)
dob_year = (@sponsor_date_of_birth["1"] || @sponsor_date_of_birth[1] || nil)
dob_day = @sponsor_date_of_birth["3"] || @sponsor_date_of_birth[3] || nil
dob_month = @sponsor_date_of_birth["2"] || @sponsor_date_of_birth[2] || nil
dob_year = @sponsor_date_of_birth["1"] || @sponsor_date_of_birth[1] || nil
if !dob_year.to_i || !dob_month.to_i || !dob_day.to_i
errors.add(:required_date_of_birth, I18n.t(:invalid_date_of_birth, scope: :error))
end
Expand All @@ -102,9 +102,9 @@ def validate_sponsor_date_of_birth

def validate_minor_date_of_birth
if @minor_date_of_birth.present?
dob_day = (@minor_date_of_birth["3"] || @minor_date_of_birth[3] || nil)
dob_month = (@minor_date_of_birth["2"] || @minor_date_of_birth[2] || nil)
dob_year = (@minor_date_of_birth["1"] || @minor_date_of_birth[1] || nil)
dob_day = @minor_date_of_birth["3"] || @minor_date_of_birth[3] || nil
dob_month = @minor_date_of_birth["2"] || @minor_date_of_birth[2] || nil
dob_year = @minor_date_of_birth["1"] || @minor_date_of_birth[1] || nil
if !dob_year.to_i || !dob_month.to_i || !dob_day.to_i
errors.add(:required_date_of_birth, I18n.t(:invalid_date_of_birth, scope: :error))
end
Expand All @@ -129,9 +129,9 @@ def validate_minor_date_of_birth

def validate_adult_date_of_birth
if @adult_date_of_birth.present?
dob_day = (@adult_date_of_birth["3"] || @adult_date_of_birth[3] || nil)
dob_month = (@adult_date_of_birth["2"] || @adult_date_of_birth[2] || nil)
dob_year = (@adult_date_of_birth["1"] || @adult_date_of_birth[1] || nil)
dob_day = @adult_date_of_birth["3"] || @adult_date_of_birth[3] || nil
dob_month = @adult_date_of_birth["2"] || @adult_date_of_birth[2] || nil
dob_year = @adult_date_of_birth["1"] || @adult_date_of_birth[1] || nil
if !dob_year.to_i || !dob_month.to_i || !dob_day.to_i
errors.add(:adult_date_of_birth, I18n.t(:invalid_date_of_birth, scope: :error))
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/unaccompanied_minor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def is_section_four_complete?
def is_section_adults_at_address_complete?
statuses = []

adults_at_address.each do |_key, val|
adults_at_address.each_value do |val|
statuses << (sponsor_resident_details?(val["given_name"], val["family_name"], val["date_of_birth"], val["nationality"], val["id_type_and_number"]) == TASK_LABEL_COMPLETE)
end

Expand Down

0 comments on commit f12f980

Please sign in to comment.