parsecom 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/parse/query.rb +10 -0
- data/lib/parse/version.rb +1 -1
- metadata +1 -1
data/lib/parse/query.rb
CHANGED
@@ -263,6 +263,16 @@ module Parse
|
|
263
263
|
self
|
264
264
|
end
|
265
265
|
|
266
|
+
def regex regex
|
267
|
+
@conditions.push ['$regex', regex.source]
|
268
|
+
self
|
269
|
+
end
|
270
|
+
|
271
|
+
# https://parse.com/questions/are-like-or-regex-queries-possible-via-the-rest-api
|
272
|
+
def starts_with str
|
273
|
+
regex %r|^\Q#{str}\E|
|
274
|
+
end
|
275
|
+
|
266
276
|
def to_s
|
267
277
|
if @conditions.size == 1 && !@conditions[0].is_a?(Array)
|
268
278
|
"#{@column_name.to_s.inspect}:#{condition_to_s @conditions[0]}"
|
data/lib/parse/version.rb
CHANGED