var Model = require('./model').Model,
    Butler = require('../../mixins/butler').Butler,
    Snitch = require('../../mixins/snitch').Snitch;

/**
 * Create the get/getPrevious functions with the type to define what accessor to retrieve
 * @param  {String} type It is used to define what accessor to retrieve, a get or getPrevious
 * @return {Function}
 */
var curryGetter = function(type){
    return function(prop){
        var accessor = this.getAccessor(prop, type),
            accessorName = this._accessorName;

        /**
         * Prevent recursive get calls by checking if it's currently accessing
         * and if the accessor name is the same as the property arg. If all positive,
         * then return the value from _data/_previousData, otherwise return from 
         * the accessor function. Fallback to returning from the _data/_previousData
         * if an accessor function does not exist.
         */
        if (accessor && accessorName != prop) {
            return accessor();
        }

        return this.parent(prop);
    }.overloadGetter();
};

Model.implement(new Butler);
Model.implement(new Snitch);

exports.Model = new Class({
    Extends: Model,

    setup: function(data, options){
        this.setupAccessors();

        this.setupSnitch();

        this.parent(data, options);

        return this;
    },

    __set: function(prop, val){
        /**
         * Use the custom setter accessor if it exists.
         * Otherwise, set the property in the regular fashion.
         */
        var accessor = this.getAccessor(prop, 'set');
        /**
         * If the accessor is true, then run it, and return false
         * to the if statement to prevent it from continuing to 
         * run through the code block
         */
        if (accessor && this._accessorName != prop) {
            return accessor.apply(this, arguments);
        }

        /**
         * Validate the property value. validate method will
         * check for existence of a a validator
         */
        if (!this.validate(prop, val)) {
            return this;
        }

        return this.parent(prop, val);
    }.overloadSetter(),

    get: curryGetter('get'),

    getPrevious: curryGetter('getPrevious'),

    setAccessor: function(name, val){
        if (name && val) {
            /**
             * Create a getPrevious method that is the get method,
             * but passed a true arg to signify it should access _previousData
             * while the get method gets passed a false value to signify it
             * should access _data.
             */
            if (val.get && !val.getPrevious) {
                val.getPrevious = val.get;
            }

            /**
             * Continue with the parent setAccessor so 
             * the set/get/getPrevious are decorated
             */
            this.parent(name, val);
        }

        return this;
    }.overloadSetter(),

    proof: function(){
        return this.parent(this.getData());
    }
});
@@ -133,16 +133,74 @@
 ).Snitch
+,%0A    signalFactory = require('../../utils/signalFactory')
 ;%0A%0A/**%0A 
@@ -1191,55 +1191,346 @@
 h);%0A
-%0Aexports.Model = new Class(%7B%0A    Extends: Model
+Model.implement(%0A    signalFactory(%0A        %5B'error'%5D,%0A        %7B%0A            signalErrorProperty: function(prop, val)%7B%0A                !this.isSilent() && this.fireEvent('error:' + prop, %5Bthis, prop, val%5D);%0A            %7D%0A        %7D%0A    )%0A);%0A%0Aexports.Model = new Class(%7B%0A    Extends: Model,%0A%0A    _errored: false,%0A%0A    _erroredProperties: %7B%7D
 ,%0A%0A 
@@ -1614,22 +1614,26 @@
 is.setup
-Snitch
+Validators
 ();%0A%0A   
@@ -2404,24 +2404,107 @@
 op, val)) %7B%0A
+            this._errored = true;%0A            this._erroredProperties%5Bprop%5D = val;%0A
             
@@ -2599,76 +2599,868 @@
     
-get: curryGetter('get'),%0A%0A    getPrevious: curryGetter('getPrevious'
+set: function(prop, val)%7B%0A        this.parent(prop, val);%0A%0A        if (!this.isSetting() && this._errored) %7B%0A            // Signal any errored properties%0A            this._onErrorProperty(this._erroredProperties);%0A%0A            // Signal error%0A            this.signalError();%0A%0A            // reset errored and errored properties%0A            this._resetErrored();%0A        %7D%0A%0A        return this;%0A    %7D,%0A%0A    get: curryGetter('get'),%0A%0A    getPrevious: curryGetter('getPrevious'),%0A%0A    _resetErrored: function()%7B%0A        if (this._errored) %7B%0A            // reset the errored%0A            this._errored = false;%0A%0A            // reset errored properties%0A            this._erroredProperties = %7B%7D;%0A        %7D%0A%0A        return this;%0A    %7D,%0A%0A    _onErrorProperty: function(prop, val)%7B%0A        this.signalErrorProperty(prop, val);%0A%0A        return this;%0A    %7D.overloadSetter(
 ),%0A%0A

Add error signal and reset.