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.17.3 db/migrate/006_works_data_fix.rb
backlog-0.17.5 db/migrate/006_works_data_fix.rb
backlog-0.18.0 db/migrate/006_works_data_fix.rb
backlog-0.17.6 db/migrate/006_works_data_fix.rb
backlog-0.2.0 db/migrate/006_works_data_fix.rb
backlog-0.19.0 db/migrate/006_works_data_fix.rb
backlog-0.2.1 db/migrate/006_works_data_fix.rb
backlog-0.20.0 db/migrate/006_works_data_fix.rb
backlog-0.20.1 db/migrate/006_works_data_fix.rb
backlog-0.21.0 db/migrate/006_works_data_fix.rb
backlog-0.21.1 db/migrate/006_works_data_fix.rb
backlog-0.21.2 db/migrate/006_works_data_fix.rb
backlog-0.21.3 db/migrate/006_works_data_fix.rb
backlog-0.22.1 db/migrate/006_works_data_fix.rb
backlog-0.22.0 db/migrate/006_works_data_fix.rb
backlog-0.23.0 db/migrate/006_works_data_fix.rb
backlog-0.24.0 db/migrate/006_works_data_fix.rb
backlog-0.23.1 db/migrate/006_works_data_fix.rb
backlog-0.25.0 db/migrate/006_works_data_fix.rb
backlog-0.26.0 db/migrate/006_works_data_fix.rb