Skip to content

Commit

Permalink
adding NULL to predicates
Browse files Browse the repository at this point in the history
  • Loading branch information
rafiki270 committed Apr 13, 2018
1 parent 8688795 commit 5b3e02d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Classes/Libs/Filter/QueryFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ extension QueryFilter {
} else if let value = value as? Date {
let predicate = NSPredicate(format: "\(field.name) \(type.interpretation) %@", value as CVarArg)
return predicate
} else if let _ = value as? NULL {
let predicate = NSPredicate(format: "\(field.name) \(type.interpretation) nil")
return predicate
}
fatalError("Not implemented")
}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ let all = try! Locomotive.query.filter("color" == "red", "hasChimney" == true).s
print(all)
```

## Author

Ondrej Rafaj (@rafiki270 on [Github](https://github.com/rafiki270), [Twitter](https://twitter.com/rafiki270) and [LiveUI Slack](http://bit.ly/2B0dEyt))

0 comments on commit 5b3e02d

Please sign in to comment.