Sha256: 0a4b04c8bcb55e2d6b24e736a1ccebd3acb48b4412cc082d2b31e9463ee90fe0

Contents?: true

Size: 287 Bytes

Versions: 123

Compression:

Stored size: 287 Bytes

Contents

class WorksDataFix < ActiveRecord::Migration
  def self.up
    Task.find(:all).each do |task|
      if task.finished_at && (task.works.last.nil? || task.works.last.todo != 0)
puts "Adding work for task #{task.id}"
        task.todo = 0
      end
    end
  end

  def self.down
  end
end

Version data entries

123 entries across 123 versions & 1 rubygems

Version Path
backlog-0.37.2 db/migrate/006_works_data_fix.rb
backlog-0.37.1 db/migrate/006_works_data_fix.rb
backlog-0.36.2 db/migrate/006_works_data_fix.rb
backlog-0.0.0 db/migrate/006_works_data_fix.rb
backlog-0.0.1 db/migrate/006_works_data_fix.rb
backlog-0.0.2 db/migrate/006_works_data_fix.rb
backlog-0.0.5 db/migrate/006_works_data_fix.rb
backlog-0.0.4 db/migrate/006_works_data_fix.rb
backlog-0.1.1 db/migrate/006_works_data_fix.rb
backlog-0.1.0 db/migrate/006_works_data_fix.rb
backlog-0.1.2 db/migrate/006_works_data_fix.rb
backlog-0.10.1 db/migrate/006_works_data_fix.rb
backlog-0.10.0 db/migrate/006_works_data_fix.rb
backlog-0.10.3 db/migrate/006_works_data_fix.rb
backlog-0.10.2 db/migrate/006_works_data_fix.rb
backlog-0.10.4 db/migrate/006_works_data_fix.rb
backlog-0.10.5 db/migrate/006_works_data_fix.rb
backlog-0.10.7 db/migrate/006_works_data_fix.rb
backlog-0.10.6 db/migrate/006_works_data_fix.rb
backlog-0.11.0 db/migrate/006_works_data_fix.rb