end
def update
attrs_to_update = resource_attrs.reject { |k,v|
[:kind, :etag, :href].index k
}
end
def update
attrs_to_update = resource_attrs.reject { |k,v|
[:kind, :etag, :href].index k
}
raise ArgumentError.new("Invalid attribute '#{attr}' in condition")
end
case operator.downcase
when '=', '<', '<=', '>', '>=', 'like'
if operand.is_a? String
cond_out << "#{table_name}.#{attr} #{operator} ?"
raise ArgumentError.new("Invalid attribute '#{attr}' in condition")
end
case operator.downcase
when '=', '<', '<=', '>', '>=', 'like'
if operand.is_a? String
cond_out << "#{table_name}.#{attr} #{operator} ?"
- if operator.match(/[<=>]/) and
- model_class.attribute_column(attr).type == :datetime
+ if (# any operator that operates on value rather than
+ # representation:
+ operator.match(/[<=>]/) and
+ model_class.attribute_column(attr).type == :datetime)
+ when 'is_a'
+ operand = [operand] unless operand.is_a? Array
+ cond = []
+ operand.each do |op|
+ cl = ArvadosModel::kind_class op
+ if cl
+ cond << "#{table_name}.#{attr} like ?"
+ param_out << cl.uuid_like_pattern
+ else
+ cond << "1=0"
+ end
+ end
+ cond_out << cond.join(' OR ')
if @where.is_a? Hash and @where.any?
conditions = ['1=1']
@where.each do |attr,value|
if @where.is_a? Hash and @where.any?
conditions = ['1=1']
@where.each do |attr,value|
session[:api_client_authorization_id] = api_client_auth.id
user = api_client_auth.user
api_client = api_client_auth.api_client
session[:api_client_authorization_id] = api_client_auth.id
user = api_client_auth.user
api_client = api_client_auth.api_client
- @object_list[:items_available] = @objects.except(:limit).count
+ @object_list[:items_available] = @objects.
+ except(:limit).except(:offset).
+ count(:id, distinct: true)
def client_accepts_plain_text_stream
(request.headers['Accept'].split(' ') &
['text/plain', '*/*']).count > 0
def client_accepts_plain_text_stream
(request.headers['Accept'].split(' ') &
['text/plain', '*/*']).count > 0