feat(etablissement): save value json data for columns

This commit is contained in:
Colin Darie 2024-11-26 18:19:19 +01:00
parent a400045964
commit f1d14bd6af
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
3 changed files with 24 additions and 4 deletions

View file

@ -211,7 +211,12 @@ class Etablissement < ApplicationRecord
end
def champ_value_json
APIGeoService.parse_etablissement_address(self)
address_data = APIGeoService.parse_etablissement_address(self)
DISPLAYABLE_COLUMNS.keys.each_with_object(address_data) do |attr, hash|
value = public_send(attr)
hash[attr.to_sym] = value if value.present?
end
end
private