Skip to content

Commit

Permalink
Handle roles without start_on gracefully in table display beitrittsda…
Browse files Browse the repository at this point in the history
…tum (HIT-895) (#1495)
  • Loading branch information
codez authored Jan 10, 2025
1 parent a7c7c2c commit e1e9bcf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/domain/table_displays/resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def antrag_fuer
end

def beitrittsdatum
start_on = group_roles.collect(&:start_on).min
start_on = group_roles.collect(&:start_on).compact.min
I18n.l(start_on) if start_on
end

Expand Down
1 change: 1 addition & 0 deletions spec/domain/table_displays/resolver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
person.roles.build(group_id: 1, start_on: Time.zone.local(2024, 1, 11, 10))
person.roles.build(group_id: 2, start_on: Time.zone.local(2023, 1, 10, 10))
person.roles.build(group_id: 1, start_on: Time.zone.local(2024, 1, 10, 10))
person.roles.build(group_id: 1, start_on: nil)

expect(resolver.to_s).to eq "10.01.2024"
end
Expand Down

0 comments on commit e1e9bcf

Please sign in to comment.