| 03850db by David A. Cuadrado at 2008-05-03 | 1 | #!/usr/bin/env ruby |
| 2 | ||
| 3 | ENV["RAILS_ENV"] ||= "production" |
|
| 4 | require File.dirname(__FILE__)+'/../config/environment' |
|
| 5 | ||
| 6 | Event.find(:all).each do |event| |
|
| 7 | begin |
|
| 5e61707 by Johan Sørensen at 2008-05-04 | 8 | event.target_type.constantize.find(event.target_id) |
| 03850db by David A. Cuadrado at 2008-05-03 | 9 | Project.find(event.project_id) |
| 10 | rescue ActiveRecord::RecordNotFound |
|
| 11 | puts "Destroying invalid event '#{event.id}:#{Action.name(event.action)}'" |
|
| 12 | event.destroy |
|
| 13 | end |
|
| 14 | end |
|
| 15 | ||
| 16 |

