This file looks large and may slow your browser down if we attempt
to syntax highlight it, so we are showing it without any
pretty colors.
Highlight
it anyway.
| 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 |
| 8 |
event.target_type.constantize.find(event.target_id) |
| 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 |