Commit 6bfc511e68ae3364bf754a39a78af9f39f1a9c8a

Authored by Manuel Meurer
1 parent 30b7e5b6
Exists in master and in 1 other branch production

Fix extract_backtraces migration, account for notices without backtrace

db/migrate/20121003223358_extract_backtraces.rb
@@ -2,7 +2,7 @@ class ExtractBacktraces < Mongoid::Migration @@ -2,7 +2,7 @@ class ExtractBacktraces < Mongoid::Migration
2 def self.up 2 def self.up
3 say "It could take long time (hours if you have many Notices)" 3 say "It could take long time (hours if you have many Notices)"
4 Notice.unscoped.all.each do |notice| 4 Notice.unscoped.all.each do |notice|
5 - backtrace = Backtrace.find_or_create(:raw => notice['backtrace']) 5 + backtrace = Backtrace.find_or_create(:raw => notice['backtrace'].presence || [])
6 notice.backtrace = backtrace 6 notice.backtrace = backtrace
7 notice['backtrace'] = nil 7 notice['backtrace'] = nil
8 notice.save! 8 notice.save!