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

Fix Ember 1.0 object.create violations in ResourceCollection #56

Closed chrsjxn closed 10 years ago

chrsjxn commented 10 years ago

This diff is a little bit hacky, so I'm not sure it's something we want to do, but basically: if the superclass's createWithMixins method is available, we use that. Otherwise, we're in 0.9.8.* and can just use the superclass's create (as this._super).

This fixes the ~17 Ember.Object.create violation warnings when you attempt to do anything with a ticket in lotus.

(The grosser alternative I found, for the curious: replace this._super.call(this, options) with this._super.call(this.extend(options), {constructor: this}). Because that constructor needs to be correctly set for the cache.)