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.6.1 db/migrate/006_works_data_fix.rb
backlog-0.6.2 db/migrate/006_works_data_fix.rb
backlog-0.6.3 db/migrate/006_works_data_fix.rb
backlog-0.6.5 db/migrate/006_works_data_fix.rb
backlog-0.6.4 db/migrate/006_works_data_fix.rb
backlog-0.7.0 db/migrate/006_works_data_fix.rb
backlog-0.6.6 db/migrate/006_works_data_fix.rb
backlog-0.7.1 db/migrate/006_works_data_fix.rb
backlog-0.7.10 db/migrate/006_works_data_fix.rb
backlog-0.7.11 db/migrate/006_works_data_fix.rb
backlog-0.7.12 db/migrate/006_works_data_fix.rb
backlog-0.7.2 db/migrate/006_works_data_fix.rb
backlog-0.7.3 db/migrate/006_works_data_fix.rb
backlog-0.7.5 db/migrate/006_works_data_fix.rb
backlog-0.7.4 db/migrate/006_works_data_fix.rb
backlog-0.7.7 db/migrate/006_works_data_fix.rb
backlog-0.7.6 db/migrate/006_works_data_fix.rb
backlog-0.7.8 db/migrate/006_works_data_fix.rb
backlog-0.7.9 db/migrate/006_works_data_fix.rb
backlog-0.8.0 db/migrate/006_works_data_fix.rb