[FIX] breakage due to backbone change: in 1.0+, this.reset() will call this.add()

in 0.9, this.add would only be called if items were provided to
reset(), changed in commit cf6e862.

bzr revid: xmo@openerp.com-20131202151037-xxmvu5790p2jsxz6
This commit is contained in:
Xavier Morel 2013-12-02 16:10:37 +01:00
parent 753cb31804
commit 0dff8277cc
1 changed files with 4 additions and 1 deletions

View File

@ -71,7 +71,10 @@ my.SearchQuery = B.Collection.extend({
},
add: function (values, options) {
options = options || {};
if (!(values instanceof Array)) {
if (!values) {
values = [];
} else if (!(values instanceof Array)) {
values = [values];
}