Skip to content

Commit

Permalink
fixed boolean predicat, refactored search method issue ember-admin#458
Browse files Browse the repository at this point in the history
  • Loading branch information
phstoned committed Mar 29, 2016
1 parent 3a33a25 commit e4a73b4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions addon/dsl/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ SearchField = Ember.Object.extend({
numberInput: function(){
this.set('isNumberInput', true);
},

boolean: function(){
this.set('isBoolean', true);
},
Expand All @@ -182,16 +182,19 @@ SearchField = Ember.Object.extend({
},

serialize: function(){
var serialzied;
var serialized;
switch(this.get('options').type){
case 'number':
serialzied = {value: this.get('value'), predicat: this.get('predicat')};
serialized = {value: this.get('value'), predicat: this.get('predicat')};
break;
case 'boolean':
serialized = {value: this.get('value'), predicat: 'eq' };
break;
default:
serialzied = {value: this.get('value')};
serialized = {value: this.get('value')};
break;
}
return serialzied;
return serialized;
}
});

Expand Down

0 comments on commit e4a73b4

Please sign in to comment.