ember-resource icon indicating copy to clipboard operation
ember-resource copied to clipboard

Schema cannot be reopened

Open jamesarosen opened this issue 13 years ago • 0 comments

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'
  }
});

jamesarosen avatar Feb 28 '12 19:02 jamesarosen