summaryrefslogtreecommitdiff
path: root/app/serializers
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/switchboard_entry_serializer.rb3
-rw-r--r--app/serializers/switchboard_serializer.rb6
2 files changed, 9 insertions, 0 deletions
diff --git a/app/serializers/switchboard_entry_serializer.rb b/app/serializers/switchboard_entry_serializer.rb
new file mode 100644
index 0000000..dace1c5
--- /dev/null
+++ b/app/serializers/switchboard_entry_serializer.rb
@@ -0,0 +1,3 @@
+class SwitchboardEntrySerializer < ActiveModel::Serializer
+ attributes :id, :name
+end
diff --git a/app/serializers/switchboard_serializer.rb b/app/serializers/switchboard_serializer.rb
new file mode 100644
index 0000000..c460add
--- /dev/null
+++ b/app/serializers/switchboard_serializer.rb
@@ -0,0 +1,6 @@
+class SwitchboardSerializer < ActiveModel::Serializer
+ embed :ids, :include => true
+
+ attributes :id, :name
+ has_many :switchboard_entries, :key => :switchboard_entry_ids, :root => :switchboardEntrys
+end