Skip to content

Instantly share code, notes, and snippets.

@StanAngeloff
Forked from stephank/gist:544175
Created August 22, 2010 19:47
Show Gist options
  • Save StanAngeloff/544187 to your computer and use it in GitHub Desktop.
Save StanAngeloff/544187 to your computer and use it in GitHub Desktop.
var Account, Model;
var __extends = function(child, parent) {
var ctor = function(){};
ctor.prototype = parent.prototype;
child.prototype = new ctor();
child.prototype.constructor = child;
if (typeof parent.extended === "function") parent.extended(child);
child.__superClass__ = parent.prototype;
};
Model = function() {};
(function() {
this.has_many = function(names) {
return (this[names] = function() {});
};
}).call(Model.prototype);
Account = function() {
return Model.apply(this, arguments);
};
__extends(Account, Model);
(function() {
this.has_many('emails');
}).call(Account.prototype);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment