ember-data-sails icon indicating copy to clipboard operation
ember-data-sails copied to clipboard

Unable to push record into store through the socket adapter.

Open jcloutz opened this issue 10 years ago • 2 comments

I receive the following error when ever a record is pushed into the store.

Uncaught Error: Assertion Failed: Passing classes to store methods has been removed. Please pass a dasherized string instead of ember-testapp@model:item:

Is this a known problem, or does anyone have a known work around?

jcloutz avatar Nov 17 '15 20:11 jcloutz

I think I figured out what was going on and it was fixed in #27. @t3rminus is there any chance that you could rebase the PR so that @huafu can merge it into master?

In sails-socket.js I changed the _handleSocketRecordCreated function to the use the model name instead of it's class reference. In my case it is expecting item and not ember-testapp@model:item

// original (not working)
store.pushPayload(type, payload)

// fixed to pass model name
store.pushPayload(type.modelName, payload);

jcloutz avatar Nov 18 '15 15:11 jcloutz

I had the same issue. I didn't come here first lol It would have saved me a lot of time, I had do manually do it.

HERRKIN avatar Feb 12 '16 01:02 HERRKIN