Created
January 14, 2013 03:05
-
-
Save hilem/4527494 to your computer and use it in GitHub Desktop.
Is this really necessary?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App = Ember.Application.create() | |
App.Adapter = DS.RESTAdapter.extend() | |
App.store = DS.Store.create({ | |
revision: 11, | |
adapter: App.Adapter.create() | |
}) | |
App.MyModel = DS.Model.extend({ | |
name: DS.attr('string') | |
}) | |
// The following works using the latest Ember/Ember-Data as of 1/13/2013 | |
// But I feel like there is a better way to do this. | |
var tmp = App.MyModel.createRecord({ name: "TEST" }) | |
App.store.adapter.createRecord(App.store, App.MyModel, tmp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With the latest ember.js you don't need to provide the adapter anymore. It is set to RESTAdapter by default.
App.MyModel.createRecord({ name: "TEST" })
App.store.commit()