X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d7b51d23da327117fd94ad32d6be791cf50cbc11..05d6c99e5b40c7e0792c44a7c2d9af5b91164f9b:/services/api/app/models/arvados_model.rb diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb index 9475f0dd1d..38c7a797d1 100644 --- a/services/api/app/models/arvados_model.rb +++ b/services/api/app/models/arvados_model.rb @@ -38,9 +38,14 @@ class ArvadosModel < ActiveRecord::Base "#{current_api_base}/#{self.class.to_s.pluralize.underscore}/#{self.uuid}" end - def self.searchable_columns + def self.searchable_columns operator + textonly_operator = !operator.match(/[<=>]/) self.columns.collect do |col| - if [:string, :text, :datetime].index(col.type) && col.name != 'owner_uuid' + if col.name == 'owner_uuid' + nil + elsif [:string, :text].index(col.type) + col.name + elsif !textonly_operator and [:datetime, :integer].index(col.type) col.name end end.compact @@ -140,7 +145,7 @@ class ArvadosModel < ActiveRecord::Base def update_modified_by_fields self.created_at ||= Time.now - self.owner_uuid ||= current_default_owner + self.owner_uuid ||= current_default_owner if self.respond_to? :owner_uuid= self.modified_at = Time.now self.modified_by_user_uuid = current_user ? current_user.uuid : nil self.modified_by_client_uuid = current_api_client ? current_api_client.uuid : nil