Method: OpenWFE::Extras::Workitem.search

Defined in:
lib/openwfe/extras/participants/activeparticipants.rb

.search(search_string, storename_list = nil) ⇒ Object

A kind of ‘google search’ among workitems

Note

when this is used on compact_workitems, it will not be able to search info within the fields, because they aren’t used by this kind of workitems. In this case the search will be limited to participant_name



382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
# File 'lib/openwfe/extras/participants/activeparticipants.rb', line 382

def self.search (search_string, storename_list=nil)

    #t = OpenWFE::Timer.new

    storename_list = Array(storename_list) if storename_list

    # participant_name

    result = find(
        :all,
        :conditions => conditions(
            "participant_name", search_string, storename_list),
        :order => "participant_name")
        # :limit => 10)

    ids = result.collect { |wi| wi.id }

    # search in fields

    fields = Field.search search_string, storename_list
    merge_search_results ids, result, fields

    #puts "... took #{t.duration} ms"

    # over.

    result
end