lib/associations/_Association.js
function (parent, name) {
            this.name = name;
            var self = this;
            this.parent = parent;
            var parentProto = parent.prototype;
            parentProto["__defineGetter__"](name, function () {
                return self._getter(this);
            });
            parentProto["__defineGetter__"](this.associatedDatasetName, function () {
                return self._filter(this);
            });

            if (!this.readOnly && this.createSetter) {
                //define a setter because we arent read only
                parentProto["__defineSetter__"](name, function (vals) {
                    self._setter(vals, this);
                });
            }

            //set up all callbacks
            ["pre", "post"].forEach(function (op) {
                ["save", "update", "remove", "load"].forEach(function (type) {
                    parent[op](type, function (next) {
                        return self["_" + op + type.charAt(0).toUpperCase() + type.slice(1)](next, this);
                    });
                }, this);
            }, this);
        }
function (parent, name) {
            this.name = name;
            var self = this;
            this.parent = parent;
            var parentProto = parent.prototype;
            parentProto["__defineGetter__"](name, function () {
                return self._getter(this);
            });
            parentProto["__defineGetter__"](this.associatedDatasetName, function () {
                return self._filter(this);
            });

            if (!this.readOnly && this.createSetter) {
                //define a setter because we arent read only
                parentProto["__defineSetter__"](name, function (vals) {
                    self._setter(vals, this);
                });
            }

            //set up all callbacks
            ["pre", "post"].forEach(function (op) {
                ["save", "update", "remove", "load"].forEach(function (type) {
                    parent[op](type, function (next) {
                        return self["_" + op + type.charAt(0).toUpperCase() + type.slice(1)](next, this);
                    });
                }, this);
            }, this);
        }
function ( parent , name ) { this . name = name ; var self = this ; this . parent = parent ; var parentProto = parent . prototype ; parentProto [ "__defineGetter__" ] ( name , function ( ) { return self . _getter ( this ) ; } ) ; parentProto [ "__defineGetter__" ] ( this . associatedDatasetName , function ( ) { return self . _filter ( this ) ; } ) ; if ( ! this . readOnly && this . createSetter ) { //define a setter because we arent read only parentProto [ "__defineSetter__" ] ( name , function ( vals ) { self . _setter ( vals , this ) ; } ) ; } //set up all callbacks [ "pre" , "post" ] . forEach ( function ( op ) { [ "save" , "update" , "remove" , "load" ] . forEach ( function ( type ) { parent [ op ] ( type , function ( next ) { return self [ "_" + op + type . charAt ( 0 ) . toUpperCase ( ) + type . slice ( 1 ) ] ( next , this ) ; } ) ; } , this ) ; } , this ) ; }
Method to inject functionality into a model. This method alters the model
to prepare it for associations, and initializes all required middleware calls
to fulfill requirements needed to loaded the associations.

@param {Model} parent the model that is having an associtaion set on it.
@param {String} name the name of the association.
Method to inject functionality into a model . This method alters the model to prepare it for associations and initializes all required middleware calls to fulfill requirements needed to loaded the associations .