From ace935fd2793b09925ab4b8a6b352585b5bdf3d2 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Thu, 27 Jun 2013 12:29:04 +0200 Subject: Switchboard shows offline label when the SipAccount has no registration. --- app/serializers/sip_account_serializer.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'app/serializers') diff --git a/app/serializers/sip_account_serializer.rb b/app/serializers/sip_account_serializer.rb index aa749b0..7465a17 100644 --- a/app/serializers/sip_account_serializer.rb +++ b/app/serializers/sip_account_serializer.rb @@ -1,7 +1,15 @@ class SipAccountSerializer < ActiveModel::Serializer embed :ids, :include => true - attributes :id, :auth_name, :caller_name, :sip_accountable_id + attributes :id, :auth_name, :caller_name, :sip_accountable_id, :is_registrated has_many :phone_numbers has_many :calls + + def is_registrated + if object.registration + true + else + false + end + end end -- cgit v1.2.3