From 2342da893d663741926c03b4f6a6f9084e3922b8 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 5 Nov 2013 15:00:47 -0500 Subject: [PATCH] Fix [object object] being rendered where it should be an ip address --- app/serializers/admin_user_serializer.rb | 4 ++++ app/serializers/screened_email_serializer.rb | 5 +++++ app/serializers/screened_ip_address_serializer.rb | 4 ++++ app/serializers/screened_url_serializer.rb | 5 +++++ 4 files changed, 18 insertions(+) diff --git a/app/serializers/admin_user_serializer.rb b/app/serializers/admin_user_serializer.rb index aac71f820..51694f981 100644 --- a/app/serializers/admin_user_serializer.rb +++ b/app/serializers/admin_user_serializer.rb @@ -83,4 +83,8 @@ class AdminUserSerializer < BasicUserSerializer scope.can_deactivate?(object) end + def ip_address + object.ip_address.try(:to_s) + end + end diff --git a/app/serializers/screened_email_serializer.rb b/app/serializers/screened_email_serializer.rb index 173bfa8e5..79c03345b 100644 --- a/app/serializers/screened_email_serializer.rb +++ b/app/serializers/screened_email_serializer.rb @@ -9,4 +9,9 @@ class ScreenedEmailSerializer < ApplicationSerializer def action ScreenedEmail.actions.key(object.action_type).to_s end + + def ip_address + object.ip_address.try(:to_s) + end + end diff --git a/app/serializers/screened_ip_address_serializer.rb b/app/serializers/screened_ip_address_serializer.rb index 2f2067925..59c95bdfc 100644 --- a/app/serializers/screened_ip_address_serializer.rb +++ b/app/serializers/screened_ip_address_serializer.rb @@ -10,4 +10,8 @@ class ScreenedIpAddressSerializer < ApplicationSerializer ScreenedIpAddress.actions.key(object.action_type).to_s end + def ip_address + object.ip_address.try(:to_s) + end + end diff --git a/app/serializers/screened_url_serializer.rb b/app/serializers/screened_url_serializer.rb index b0edff3fd..6768ae10b 100644 --- a/app/serializers/screened_url_serializer.rb +++ b/app/serializers/screened_url_serializer.rb @@ -10,4 +10,9 @@ class ScreenedUrlSerializer < ApplicationSerializer def action ScreenedUrl.actions.key(object.action_type).to_s end + + def ip_address + object.ip_address.try(:to_s) + end + end