Skip to content

Commit

Permalink
fix endswith operand
Browse files Browse the repository at this point in the history
  • Loading branch information
ishai committed Aug 17, 2014
1 parent 45939dc commit 1a010d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jest",
"description": "JavaScriptational State Transfer. JS restful API layer with Mongoose based resources. Inspired by python Tastypie",
"version": "0.1.37",
"version": "0.1.38",
"author": "Ishai Jaffe <[email protected]>",
"contributors": [
{
Expand Down
4 changes: 2 additions & 2 deletions resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ var Resource = module.exports = Class.extend({
delete filters[field];
}
if(operand == 'endswith') {
filters[field.replace('__endswith','')] = new RegExp(this.escape_regex(filters[field] + '$'));
filters[field.replace('__endswith','')] = new RegExp(this.escape_regex(filters[field]) + '$');
delete filters[field];
}
if(operand == 'iexact') {
Expand All @@ -719,7 +719,7 @@ var Resource = module.exports = Class.extend({
delete filters[field];
}
if(operand == 'iendswith') {
filters[field.replace('__iendswith','')] = new RegExp(this.escape_regex(filters[field] + '$'),'i');
filters[field.replace('__iendswith','')] = new RegExp(this.escape_regex(filters[field]) + '$','i');
delete filters[field];
}
if (field == 'or')
Expand Down

0 comments on commit 1a010d1

Please sign in to comment.