From 447b31c9e865576482921872afd04f68022ed7f9 Mon Sep 17 00:00:00 2001 From: Kristian Garza Date: Tue, 7 May 2019 14:58:47 +0200 Subject: [PATCH 1/2] index billing information as object rrather than as string https://sentry.io/share/issue/02a48a23fb644f3e8fab0ef3445985be/ --- app/models/provider.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/provider.rb b/app/models/provider.rb index af4c6080b..7e0654468 100644 --- a/app/models/provider.rb +++ b/app/models/provider.rb @@ -137,7 +137,12 @@ def as_indexed_json(options={}) "joined" => joined, "twitter_handle" => twitter_handle, "ror_id" => ror_id, - "billing_information" => billing_information, + "billing_information" => { + "address" => address, + "postCode" => post_code, + "state" => state, + "city" => city + }, "created" => created, "updated" => updated, "deleted_at" => deleted_at, From bd86d18d1d48a3016fbf4f59534400f434505190 Mon Sep 17 00:00:00 2001 From: Kristian Garza Date: Tue, 7 May 2019 14:59:03 +0200 Subject: [PATCH 2/2] fabirca is always expecting an object --- app/serializers/provider_serializer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/serializers/provider_serializer.rb b/app/serializers/provider_serializer.rb index 542fb6f86..6c06e55a9 100644 --- a/app/serializers/provider_serializer.rb +++ b/app/serializers/provider_serializer.rb @@ -22,7 +22,7 @@ class ProviderSerializer end attribute :billing_information, if: Proc.new { |object, params| params[:current_ability] && params[:current_ability].can?(:read_billing_information, object) == true } do |object| - object.billing_information.transform_keys!{ |key| key.to_s.camelcase(:lower) } if object.billing_information.present? + object.billing_information.present? ? object.billing_information.transform_keys!{ |key| key.to_s.camelcase(:lower) } : {} end attribute :twitter_handle, if: Proc.new { |object, params| params[:current_ability] && params[:current_ability].can?(:read_billing_information, object) == true } do |object|