Skip to content

Commit

Permalink
Use a pipe to squash address attrs into line1
Browse files Browse the repository at this point in the history
  • Loading branch information
pskl committed Feb 19, 2025
1 parent eaaaf0a commit ffbe78d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/apis/students_api/fregata/mappers/address_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AddressMapper < Dry::Transformer::Pipe

nest :address_line1, %i[ligne2 ligne3 ligne4 ligne5 ligne6 ligne7]

map_value :address_line1, ->(hash) { hash.values.compact.join(" ") }
map_value :address_line1, ->(hash) { hash.values.compact.join(" | ") }

accept_keys %i[
address_postal_code
Expand Down
2 changes: 1 addition & 1 deletion app/apis/students_api/sygne/mappers/address_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AddressMapper < Dry::Transformer::Pipe

nest :address_line1, %i[adresseLigne1 adresseLigne2 adresseLigne3 adresseLigne4]

map_value :address_line1, ->(hash) { hash.values.compact.join(" ") }
map_value :address_line1, ->(hash) { hash.values.compact.join(" | ") }

accept_keys %i[
address_postal_code
Expand Down

0 comments on commit ffbe78d

Please sign in to comment.