Class: OpenWFE::Extras::Field
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- OpenWFE::Extras::Field
- Defined in:
- lib/openwfe/extras/participants/activeparticipants.rb
Overview
A Field (Attribute) of a Workitem.
Class Method Summary collapse
-
.new_field(key, value) ⇒ Object
A quick method for doing.
-
.search(text, storename_list = nil) ⇒ Object
Will return all the fields that contain the given text.
Instance Method Summary collapse
Class Method Details
.new_field(key, value) ⇒ Object
470 471 472 473 474 475 476 477 |
# File 'lib/openwfe/extras/participants/activeparticipants.rb', line 470 def self.new_field (key, value) f = Field.new f.fkey = key f.vclass = value.class.to_s f.value = value f end |
.search(text, storename_list = nil) ⇒ Object
Will return all the fields that contain the given text.
Looks in svalue and fkey. Looks as well in yvalue if it contains a string.
This method is used by Workitem.search()
503 504 505 506 507 508 509 510 511 512 513 514 |
# File 'lib/openwfe/extras/participants/activeparticipants.rb', line 503 def self.search (text, storename_list=nil) cs = build_search_conditions(text) if storename_list cs[0] = "(#{cs[0]}) AND workitems.store_name IN (?)" cs << storename_list end find :all, :conditions => cs, :include => :workitem end |
Instance Method Details
#value ⇒ Object
490 491 492 493 |
# File 'lib/openwfe/extras/participants/activeparticipants.rb', line 490 def value self.svalue || self.yvalue end |
#value=(v) ⇒ Object
479 480 481 482 483 484 485 486 487 488 |
# File 'lib/openwfe/extras/participants/activeparticipants.rb', line 479 def value= (v) limit = connection.native_database_types[:string][:limit] if v.is_a?(String) and v.length <= limit self.svalue = v else self.yvalue = v end end |