Created
July 9, 2012 15:16
-
-
Save mikefrey/3077105 to your computer and use it in GitHub Desktop.
Backbone.js SuperDeepModel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
function hOPExtend(obj) { | |
var args = Array.prototype.slice.call(arguments, 1) | |
for (var i = 0; i < args.length; i++) { | |
source = args[i] | |
for (var prop in source) if (source.hasOwnProperty(prop)) { | |
obj[prop] = source[prop]; | |
} | |
} | |
return obj; | |
} | |
Backbone.SuperDeepModel = Backbone.DeepModel.extend(hOPExtend({}, Supermodel.Model.prototype), hOPExtend({}, Supermodel.Model)) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated to fix issues with Supermodel associations.