projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix api server tests.
[arvados.git]
/
services
/
api
/
lib
/
record_filters.rb
diff --git
a/services/api/lib/record_filters.rb
b/services/api/lib/record_filters.rb
index 994e8503106ad6ec3e931e555f2f28d8d455a1da..5688ca6140f17fcef94ed112481cddb06e75c668 100644
(file)
--- a/
services/api/lib/record_filters.rb
+++ b/
services/api/lib/record_filters.rb
@@
-19,7
+19,7
@@
module RecordFilters
# +model_class+ subclass of ActiveRecord being filtered
#
# Output:
# +model_class+ subclass of ActiveRecord being filtered
#
# Output:
- # Hash with t
wo
keys:
+ # Hash with t
he following
keys:
# :cond_out array of SQL fragments for each filter expression
# :param_out array of values for parameter substitution in cond_out
# :joins array of joins: either [] or ["JOIN containers ON ..."]
# :cond_out array of SQL fragments for each filter expression
# :param_out array of values for parameter substitution in cond_out
# :joins array of joins: either [] or ["JOIN containers ON ..."]
@@
-140,6
+140,10
@@
module RecordFilters
raise ArgumentError.new("Invalid operand '#{operand}' for '#{operator}' must be true or false")
end
param_out << proppath
raise ArgumentError.new("Invalid operand '#{operand}' for '#{operator}' must be true or false")
end
param_out << proppath
+ when 'contains'
+ cond_out << "#{attr_table_name}.#{attr} @> ?::jsonb OR #{attr_table_name}.#{attr} @> ?::jsonb"
+ param_out << SafeJSON.dump({proppath => operand})
+ param_out << SafeJSON.dump({proppath => [operand]})
else
raise ArgumentError.new("Invalid operator for subproperty search '#{operator}'")
end
else
raise ArgumentError.new("Invalid operator for subproperty search '#{operator}'")
end