diff --git a/db/migrate/20150906083453_delete_anonymous_jour.rb b/db/migrate/20150906083453_delete_anonymous_jour.rb new file mode 100644 index 000000000..5361eb5e1 --- /dev/null +++ b/db/migrate/20150906083453_delete_anonymous_jour.rb @@ -0,0 +1,15 @@ +class DeleteAnonymousJour < ActiveRecord::Migration + def up + jour_count = Journal.all.count / 30 + 2 + transaction do + for i in 1 ... jour_count do i + Journal.page(i).per(30).each do |jour| + jour.destroy if jour.user_id == 2 + end + end + end + end + + def down + end +end