From ef1e16791643da12ee93b16cd23c13e9dec37dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Tue, 2 Oct 2018 15:45:18 +0300 Subject: [PATCH] Fix errors in identities serializer --- .../kps/queries/identities_serializer.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/serializers/kps/queries/identities_serializer.rb b/app/serializers/kps/queries/identities_serializer.rb index b1b61748..b779b7a9 100644 --- a/app/serializers/kps/queries/identities_serializer.rb +++ b/app/serializers/kps/queries/identities_serializer.rb @@ -44,7 +44,10 @@ class IdentitiesSerializer < Serializer fathers_id_number: personal_informations[:baba_tc_kimlik_no].safe_to_i, mothers_id_number: personal_informations[:anne_tc_kimlik_no].safe_to_i, real_person_id_number: personal_informations[:gercek_kisi_kimlik_no].safe_to_i, - country: personal_informations[:ulke].titleize_tr, + country: { + code: personal_informations.dig(:ulke, :kod).safe_to_i, + description: personal_informations.dig(:ulke, :aciklama).titleize_tr + }, status_informations: status_informations, basic_informations: basic_informations } @@ -60,7 +63,10 @@ class IdentitiesSerializer < Serializer code: card_informations.dig(:cinsiyet, :kod).safe_to_i, description: card_informations.dig(:cinsiyet, :aciklama).titleize_tr }, - nationality: card_informations[:uyruk].titleize_tr, + nationality: { + code: card_informations.dig(:uyruk, :kod).safe_to_i, + description: card_informations.dig(:uyruk, :aciklama).titleize_tr + }, marital_status: { code: card_informations.dig(:medeni_hal, :kod).safe_to_i, description: card_informations.dig(:medeni_hal, :aciklama).titleize_tr @@ -73,7 +79,10 @@ class IdentitiesSerializer < Serializer number: card_informations[:no].safe_to_i, registration_number: card_informations[:kayit_no].safe_to_i, serial_number: card_informations[:seri], - issuing_reason: card_informations[:verilis_neden].titleize_tr, + issuing_reason: { + code: card_informations.dig(:verilis_neden, :kod).safe_to_i, + description: card_informations.dig(:verilis_neden, :aciklama).titleize_tr + }, issuing_date: build_date(*card_informations[:verilme_tarih].values_at(:yil, :ay, :gun)) }