From adc5d82c5852c6a6b6d64c96e39b5e4d4452e82b Mon Sep 17 00:00:00 2001 From: Sascha Korth Date: Mon, 12 Aug 2013 17:55:17 +0200 Subject: [PATCH] Check backtrace on migration - issue #540 --- db/migrate/20121003223358_extract_backtraces.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/migrate/20121003223358_extract_backtraces.rb b/db/migrate/20121003223358_extract_backtraces.rb index b6ab319..388f905 100644 --- a/db/migrate/20121003223358_extract_backtraces.rb +++ b/db/migrate/20121003223358_extract_backtraces.rb @@ -2,6 +2,7 @@ class ExtractBacktraces < Mongoid::Migration def self.up say "It could take long time (hours if you have many Notices)" Notice.unscoped.all.each do |notice| + next if notice.backtrace.present? || notice['backtrace'].nil? backtrace = Backtrace.find_or_create(:raw => notice['backtrace'] || []) notice.backtrace = backtrace notice['backtrace'] = nil @@ -12,4 +13,4 @@ class ExtractBacktraces < Mongoid::Migration def self.down end -end +end \ No newline at end of file -- libgit2 0.21.2