Commit 399627f3f0001372302a1a376e3121fb73c87ade

Authored by Vasiliy Ermolovich
2 parents c46d09e5 c49024bf
Exists in master and in 1 other branch production

Merge pull request #334 from krautcomputing/fix_extract_backtraces_migration

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'] || [])
6 notice.backtrace = backtrace 6 notice.backtrace = backtrace
7 notice['backtrace'] = nil 7 notice['backtrace'] = nil
8 notice.save! 8 notice.save!