Skip to content

Commit

Permalink
Various fixes (#239)
Browse files Browse the repository at this point in the history
* Handle Enumerables specifically

This avoids errors if the list is empty.

* Translation was missing, breaking click-testing in dev

* Conform to Linter and Styleguide
  • Loading branch information
kronn authored Feb 25, 2025
1 parent 8fc43ea commit 4a4c757
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
10 changes: 9 additions & 1 deletion app/domain/export/tabular/messages/letters_with_invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,15 @@ def message
end

def invoice_list
@invoice_list ||= list.first.first.invoice_list
@invoice_list ||= begin
if list.respond_to?(:peek)
list.peek
else
list.first
end.first.invoice_list
rescue StopIteration
nil
end
end
end
end
4 changes: 4 additions & 0 deletions config/locales/views.die_mitte.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ de:
address:
two_with_same_last_name: '%{first} und %{second} %{last_name}'
placeholder: Platzhalter

roles:
fields:
help_optional_label: Optionale Bezeichnung der Rolle dieser Person
2 changes: 0 additions & 2 deletions lib/hitobito_die_mitte/wagon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class Wagon < Rails::Engine
#{config.root}/app/jobs ]

config.to_prepare do
# rubocop:disable Metrics/LineLength
# extend application classes here
Group.include DieMitte::Group
Role.include DieMitte::Role
Expand Down Expand Up @@ -57,7 +56,6 @@ class Wagon < Rails::Engine

InvoiceItem.add_type_mapping(:variable_donation, InvoiceItem::VariableDonation)
Role::Permissions << :complete_finance
# rubocop:enable Metrics/LineLength
end

initializer "die_mitte.add_settings" do |_app|
Expand Down

0 comments on commit 4a4c757

Please sign in to comment.