Changeset 408
- Timestamp:
- 01/12/07 15:26:34 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2-alpha/app/models/work_order.rb
r371 r408 32 32 exports_automatic_field 'cmms_work_order_working_time', :float, :working_time 33 33 exports_automatic_field 'cmms_work_order_priority', :integer, :priority 34 exports_automatic_field 'cmms_work_order_comments', :string, :comments_as_string 34 35 35 36 … … 306 307 end 307 308 309 def comments_as_string 310 comments = self.work_order_events.find(:all, :readonly => true).collect { |event| [event.created_at, event.creator, event.comment_text] } 311 result = [] 312 for creation_date, creator, text in comments 313 result.push(format_date(creation_date) + ' - ' + creator.login_and_name + ' - ' + text.gsub("\n", ' ')) 314 end 315 return result.join(' | ') 316 end 317 308 318 protected 309 319