From 6bfc511e68ae3364bf754a39a78af9f39f1a9c8a Mon Sep 17 00:00:00 2001 From: Manuel Meurer Date: Thu, 15 Nov 2012 19:39:32 +0100 Subject: [PATCH] Fix extract_backtraces migration, account for notices without backtrace --- db/migrate/20121003223358_extract_backtraces.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20121003223358_extract_backtraces.rb b/db/migrate/20121003223358_extract_backtraces.rb index 7ca3ee6..484149f 100644 --- a/db/migrate/20121003223358_extract_backtraces.rb +++ b/db/migrate/20121003223358_extract_backtraces.rb @@ -2,7 +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| - backtrace = Backtrace.find_or_create(:raw => notice['backtrace']) + backtrace = Backtrace.find_or_create(:raw => notice['backtrace'].presence || []) notice.backtrace = backtrace notice['backtrace'] = nil notice.save! -- libgit2 0.21.2