emberjs / ember-data-fixture-adapter Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Error while processing route: todos serializer.get is not a function TypeError: serializer.get is not a function
Application Adapter:
import Adapter from 'ember-data-fixture-adapter';
export default Adapter.extend({
shouldReloadRecord: function() {
return true;
},
shouldReloadAll: function() {
return true;
}
});
We all know fixture-adapter no longer lives in Ember Data but in this repo.
https://github.com/emberjs/data/blob/master/CHANGELOG.md#breaking-changes
You can use it as an addon, or build it using Ember Giftwrap.
https://github.com/ef4/ember-giftwrap#how
Why is this important / relevant? To allow demos and tutorials use Fixture Adapter as previously...
Lately I am busy with the update to Ember 1.13, Ember Data 1.13 etc. As we use fixtures in our app, I tried this addon.
After I installed it with ember install ember-data-fixture-adapter
the deprecation warning did not go away. Are there extra steps I am missing (adding a js to the ember-cli-build for example)?
I use fixtures to represent models that have not been added to the DB yet so I can't use restAdapter.
Upgraded to latest ED and then fixtures stopped working. Installed this addon and still not working.
import DS from 'ember-data';
export default DS.FixtureAdapter;
TypeError: serializer.get is not a function
at ember$data$lib$system$store$serializer$response$$normalizeResponseHelper (serializer-response.js:42)
For anyone using Fixtures and upgrading to latest ED it is a total blocker with no info on how to fix.
I'm using Ember and Ember Data both 2.15.0, and I needed to wrap the response of the FixtureAdapter methods in order for them to be recognised by the calling method (from the Ember Data Store?) and processed into real Ember.Models. Eg:
// app/adapters/post.js
import FixtureAdapter from 'ember-data-fixture-adapter';
export default FixtureAdapter.extend({
simulateRemoteResponse: false,
findAll: function(){
return this._super.apply(this, arguments).then(function(response){
return { posts: response };
});
}
});
I'm using a RESTSerializer, if that matters, but I can't see how.
Is this intentional? Or perhaps caused by changes to Ember Data?
I'm currently upgrading from Ember 1.13 to 2.15.
The exact same fixtures and models worked fine in 1.13 using the built-in DS.FixtureAdapter, without needing to wrap the responses.
I don't have admin rights. Can somebody do this please? @emberjs/owners
Hello. I use Ember : 2.2.0, Ember Data : 2.2.0 and ember-data-fixture-adapter last version.
I have a model with a large many entries. How do I withdraw one entries, recording by id =1.
If i use return this.store.queryRecord('video', { filter: { id: '1' } }).then(function(tomster) {
});
in my model, Console say -
Error while processing route: video Assertion Failed: You tried to make a query but your adapter does not implementqueryRecord
Error: Assertion Failed: You tried to make a query but your adapter does not implementqueryRecord
return this.store.findAll('video');
All records without errors. But I need one! where id =1 =)
For examle, my files:
adapters/application.js
import DS from 'ember-data';
export { default } from 'ember-data-fixture-adapter';
models/video.js
import DS from 'ember-data';
var Video = DS.Model.extend({
title: DS.attr('string'),
num: DS.attr('string')
});
Video.reopenClass({
FIXTURES: [
{
id: 1,
num: '1',
title: "Something something Basecamp1"
},
{
id: 2,
num: '2',
title: "Something something Basecamp2"
}
]
});
export default Video;
routes/video.js
import Ember from 'ember';
export default Ember.Route.extend({
model(params) {
return this.store.queryRecord('video', { filter: { id: '1' } }).then(function(tomster) {
});
}
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.