feat(etablissement): save value json data for columns
This commit is contained in:
parent
a400045964
commit
f1d14bd6af
3 changed files with 24 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue