diff options
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/switchboard_entry_serializer.rb | 2 | ||||
-rw-r--r-- | app/serializers/switchboard_serializer.rb | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/app/serializers/switchboard_entry_serializer.rb b/app/serializers/switchboard_entry_serializer.rb index dace1c5..0b5f4c1 100644 --- a/app/serializers/switchboard_entry_serializer.rb +++ b/app/serializers/switchboard_entry_serializer.rb @@ -1,3 +1,5 @@ class SwitchboardEntrySerializer < ActiveModel::Serializer attributes :id, :name + + has_many :phone_numbers, embed: :ids end diff --git a/app/serializers/switchboard_serializer.rb b/app/serializers/switchboard_serializer.rb index c460add..2912a56 100644 --- a/app/serializers/switchboard_serializer.rb +++ b/app/serializers/switchboard_serializer.rb @@ -1,6 +1,7 @@ class SwitchboardSerializer < ActiveModel::Serializer - embed :ids, :include => true - attributes :id, :name - has_many :switchboard_entries, :key => :switchboard_entry_ids, :root => :switchboardEntrys + + embed :ids + + has_many :switchboard_entries, :key => :switchboard_entrys end |