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

Schema cannot be reopened #34

Open jamesarosen opened 12 years ago

jamesarosen commented 12 years ago

When sharing code across multiple projects, it makes sense to put core classes in a shared library. Individual projects would then reopen the core classes to add functionality specific to their use-cases. For example:

User = Ember.Resource.define({
  organization: { type: 'Organization', nested: true }
});
User.reopenSchema({
  posts: {
    type: Ember.ResourceCollection,
    itemType: 'BlogPost',
    url: '/users/%@/posts'
  }
});