Skip to content

Commit

Permalink
Support Induction records without a period end date
Browse files Browse the repository at this point in the history
In production, there are induction records without a period end date and
this appears to be a valid state we should support.
  • Loading branch information
felixclack committed Jul 19, 2023
1 parent 24c4570 commit a1e8dd6
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions app/components/induction_summary_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ def history
.periods
.map do |period|
[
{ key: { text: "Appropriate body" }, value: { text: period.appropriate_body.name } },
{
key: {
text: "Appropriate body"
},
value: {
text: period.appropriate_body.name
}
},
{
key: {
text: "Start date"
Expand All @@ -29,7 +36,14 @@ def history
text: period.start_date.to_date.to_fs(:long_uk)
}
},
{ key: { text: "End date" }, value: { text: period.end_date.to_date.to_fs(:long_uk) } },
{
key: {
text: "End date"
},
value: {
text: period.end_date&.to_date&.to_fs(:long_uk)
}
},
{ key: { text: "Number of terms" }, value: { text: period.terms } }
]
end
Expand All @@ -38,8 +52,22 @@ def history

def rows
[
{ key: { text: "Status" }, value: { text: details.status.to_s.humanize } },
{ key: { text: "Completed" }, value: { text: awarded_at&.to_fs(:long_uk) } },
{
key: {
text: "Status"
},
value: {
text: details.status.to_s.humanize
}
},
{
key: {
text: "Completed"
},
value: {
text: awarded_at&.to_fs(:long_uk)
}
},
{
key: {
text: "Certificate"
Expand Down

0 comments on commit a1e8dd6

Please sign in to comment.