Skip to content

Instantly share code, notes, and snippets.

@tgriesser
Created January 20, 2014 16:22
Show Gist options
  • Save tgriesser/8523267 to your computer and use it in GitHub Desktop.
Save tgriesser/8523267 to your computer and use it in GitHub Desktop.
_.each(['hasMany', 'hasOne', 'belongsToMany', 'morphOne', 'morphMany', 'belongsTo', 'through'], function(method) {
var original = Model.prototype[method]
Model.prototype[method] = function() {
// Stuff here
return original.apply(this, ...)
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment