staugaard / ember-resource

This project has moved. The canonical repository is now located at: https://github.com/zendesk/ember-resource
https://github.com/zendesk/ember-resource
Apache License 2.0
122 stars 27 forks source link

Add ability to subclass definitions #3

Closed jamesarosen closed 13 years ago

jamesarosen commented 13 years ago

given a resource class:

Foo = SC.Resource.define({
  url: '/foos',
  schema: {
    id: Number,
    name: String,
    created_at: Date
  }
});

I'd like to be able to subclass Foo and reopen the schema. Perhaps something like

Bar = Foo.define({
  url: '/bars',
  schema: $.extend({}, Foo.schema, {
    foo: { type: Foo, path: "foo_id" }
  })
});
staugaard commented 13 years ago

Done