Debug Serializers (driving me nuts)


#1

I switched to Ember-Cli from a plain old Ember application.

The problem is that my models are not being properly serialized.

How can I debug all serializers to see what is going on?

  • The application serializer
  • The adapter serializer
  • The model serializer

Can I for example do this with a console.log in custom adapters createRecord() function?

Thanks


#2

Ok, i got this working. First I had to generate a serializer with ember-cli

ember generate serializer application

And then I simply added this to ensure it’s working.

import DS from 'ember-data';

    export default DS.RESTSerializer.extend({
    	serialize: function(record, options) {
    	    console.log('YES ITS BLOODY USING THE REST SERIALIZER');
    	    this._super(record, options);
      	}
    });

I a still curious if there was another way to do this :slight_smile:


#3

Creating the serializer was exactly what you needed to do, afaik (as Ember won’t create one automatically). You can remove the serialize function though, no longer serves a purpose.


#4

Curious, where would a console.log in the serializer show up anyway?


#5

Tried this, didn’t work. Can’t figure out how to debug serializers/adapters either, would be nice to have more control over the process, having hooks like normalize() is nice, but if I cant’t see what is going on when this hooks are called (also to check if they are called), makes things difficult to debug.