Project

General

Profile

Patch #7578 ยป migrate_from_trac_ownerchanges.patch

Pierre-Luc Samuel, 2011-02-08 23:17

View differences:

lib/tasks/migrate_from_trac.rake (working copy)
487 487
              status_change = changeset.select {|change| change.field == 'status'}.first
488 488
              resolution_change = changeset.select {|change| change.field == 'resolution'}.first
489 489
              comment_change = changeset.select {|change| change.field == 'comment'}.first
490
              owner_change = changeset.select {|change| change.field == 'owner'}.first
490 491

  
491 492
              n = Journal.new :notes => (comment_change ? convert_wiki_text(encode(comment_change.newvalue)) : ''),
492 493
                              :created_on => time
......
507 508
                                               :old_value => resolution_change.oldvalue,
508 509
                                               :value => resolution_change.newvalue)
509 510
              end
511
              if owner_change
512
                n.details << JournalDetail.new(:property => 'attr',
513
                                               :prop_key => 'assigned_to_id',
514
                                               :old_value => find_or_create_user(owner_change.oldvalue),
515
                                               :value => find_or_create_user(owner_change.newvalue))
516
              end
510 517
              n.save unless n.details.empty? && n.notes.blank?
511 518
          end
512 519

  
    (1-1/1)