lcoq / ember-validations

Ember-Validations - An Ember.js library for handling object validations
MIT License
122 stars 25 forks source link

Allow validators to receive function as option #1

Closed lcoq closed 12 years ago

lcoq commented 12 years ago

With the NumericalityValidator, for example, the following code should works:

App.Pub = Ember.Object.extend(Ember.Validations, {
  totalCount: 12,
  validations: {
    bars: { 
      lessThan: function() {
        return this.get('totalCount');
      }
  }
});
lcoq commented 12 years ago

Corrected in commits: