I have a simple active model serializer:
class ActivitySerializer < ActiveModel::Serializer attributes :id, :title, :description, :time has_one :category has_one :user end
I also have category and user serializers, and they work as expected. I get this payload:
{"activities":[{"id":1,"title":"Test Activity","description":null,"time":"2014-03-01T06:05:41.027Z","category":{"id":1,"title":"Sports"},"user":{"id":1,"name":"ember"}}]}
However, they do not load in ember.
App.Activity = DS.Model.extend title: DS.attr('string') description: DS.attr('string') time: DS.attr('date') category: DS.belongsTo('category') user: DS.belongsTo('user') App.Category = DS.Model.extend title: DS.attr('string') activities: DS.hasMany('activity') App.User = DS.Model.extend name: DS.attr('string') activities: DS.hasMany('activity')
When I check the ember inspector, the data is not loading. What format does ActiveModelSerializer expect? It loads activity, but not category or user attributes.
source share