summaryrefslogtreecommitdiff
path: root/app/serializers/sip_account_serializer.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-06-27 12:29:04 +0200
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-06-27 12:29:04 +0200
commitace935fd2793b09925ab4b8a6b352585b5bdf3d2 (patch)
tree2d96ad4a82de25a9ab4e00129dea3f4c3777ecb7 /app/serializers/sip_account_serializer.rb
parentbdb14342dd502ea01a83a791bb51507a82522daf (diff)
Switchboard shows offline label when the SipAccount has no registration.
Diffstat (limited to 'app/serializers/sip_account_serializer.rb')
-rw-r--r--app/serializers/sip_account_serializer.rb10
1 files changed, 9 insertions, 1 deletions
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