emberjs/data — Issue #131: RESTAdapter url generation is borked
Author: mdi
Created: 2012-02-29 20:43:39+00:00
State: open

Using this code:

LiveJam.store = DS.Store.create({
revision: 2,
adapter: DS.RESTAdapter.create()
})

LiveJam.Models.Event = DS.Model.extend
id: DS.attr("number"),
venue: DS.belongsTo("LiveJam.Models.Venue"),
user: DS.belongsTo("LiveJam.Models.User"),
starts_at: DS.attr("date"),
ends_at: DS.attr("date"),
url: DS.attr("string")

Then doing `LiveJam.store.find(LiveJam.Models.Event, 1)` tries to call this URL:

http://example.com/model)s/1

Which is a bad URL obviously. I know I can reopen the class and specify the URL manually, but the auto-generation of the URL is broken in the `rootForType` function because the "type" of LiveJam.Models.Event is `(subclass of DS.Model)`.